/* ==========================================================================
   BASE RESET & GLOBAL STYLES
   Single Responsibility: Global resets, body, container, utility classes
   Mobile-First Approach
   ========================================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent; /* Removes default grey tap overlay on iOS Safari */
}

html {
    /* Prevent pull-to-refresh and overscroll bounce on mobile */
    overscroll-behavior: none;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(-45deg, #EEF2F7, #DFE6ED, #EBF0F6, #F1F5F9);
    background-size: 400% 400%;
    animation: gradientBg 15s ease infinite;
    color: var(--text-dark);
    height: 100vh;
    height: 100dvh; /* Accurate visible height on iPhone Safari with bottom bar */
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent overscroll bouncing on iOS */
    overscroll-behavior: none;
    position: fixed;
    width: 100%;
    touch-action: manipulation; /* Faster click responses, no double-tap zoom */
}

/* Main Container — Mobile-first compact padding */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh; /* Matches dynamic height to prevent home indicator cutoffs */
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    overflow: hidden;
}

/* Desktop container */
@media (min-width: 801px) {
    .app-container {
        max-width: 1800px;
        padding: 0 12px;
    }
}

/* Utilities */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
