

:root {
    
    --color-primary: #ffc85a;
    --color-primary-dark: #c99e43;
    --color-bg: #050505;
    --color-surface: #0b1014;
    --color-surface-light: #1a1f24;
    --color-text: #f6f8ff;
    --color-text-secondary: rgba(246, 248, 255, 0.7);
    --color-text-disabled: rgba(246, 248, 255, 0.4);
    --color-border: rgba(255, 255, 255, 0.1);
    --color-success: #4caf50;
    --color-warning: #ff9800;
    --color-error: #f44336;

    
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;

    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 32px;

    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(255, 255, 90, 0.3);
    --shadow-glow-strong: 0 0 30px rgba(255, 104, 90, 0.5);

    
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;

    
    --font-main: 'Montserrat', sans-serif;
    --font-accent: 'Orbitron', sans-serif;

    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-md: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 24px;
    --font-size-xxl: 32px;
    --font-size-huge: 48px;

    
    --topbar-height: 80px;
    --navbar-height: 72px;
    --max-width: 600px;
}



* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-bg);
    color: var(--color-text);
    overflow-x: hidden;
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, textarea {
    font-family: inherit;
}

img {
    max-width: 100%;
    height: auto;
}



.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: var(--max-width);
    margin: 0 auto;
    background: url('../assets/pages/main/background.webp') center center / cover no-repeat;
}

.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--topbar-height);
    background: linear-gradient(180deg, var(--color-surface) 0%, rgba(11, 16, 20, 0.95) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
}

.main-content {
    flex: 1;
    padding: var(--spacing-lg) var(--spacing-md);
    padding-bottom: calc(var(--navbar-height) + var(--spacing-lg));
    overflow-y: auto;
}

.navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: var(--max-width);
    margin: 0 auto;
    height: var(--navbar-height);
    background: linear-gradient(180deg, rgba(11, 16, 20, 0.95) 0%, var(--color-surface) 100%);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--color-border);
    z-index: 100;
}



.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-bg);
    display: none;
    align-items: stretch;
    justify-content: center;
    z-index: 9999;
}

.splash-screen.active {
    display: flex;
}

.splash-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.splash-logo {
    width: 80%;
    max-width: 360px;
    height: auto;
    display: block;
    object-fit: contain;
}

.splash-title {
    font-family: var(--font-accent);
    font-size: var(--font-size-huge);
    font-weight: 600;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.8s ease-out 0.3s backwards;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--color-surface-light);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-lg);
}

.loading-text {
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-xl);
}

.progress-bar {
    width: 200px;
    height: 4px;
    background-color: var(--color-surface-light);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
    width: 0%;
    animation: progressFill 2s ease-in-out forwards;
}



.flex-row {
    display: flex;
    flex-direction: row;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-xs { gap: var(--spacing-xs); }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }
.gap-xl { gap: var(--spacing-xl); }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-accent { font-family: var(--font-accent); }

.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-disabled { color: var(--color-text-disabled); }

.hidden { display: none !important; }



::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-surface);
}

::-webkit-scrollbar-thumb {
    background: var(--color-surface-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 192, 90, 0.3);
}


/* ===================================
   MOBILE ADAPTATION & MEDIA QUERIES
   =================================== */

/* Safe area support for notched devices (iPhone X+) */
@supports (padding: env(safe-area-inset-bottom)) {
    .main-content {
        padding-left: max(var(--spacing-md), env(safe-area-inset-left));
        padding-right: max(var(--spacing-md), env(safe-area-inset-right));
        padding-bottom: calc(var(--navbar-height) + var(--spacing-lg) + env(safe-area-inset-bottom));
    }

    .navigation {
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(var(--navbar-height) + env(safe-area-inset-bottom));
    }

    .top-bar {
        padding-top: env(safe-area-inset-top);
        height: calc(var(--topbar-height) + env(safe-area-inset-top));
    }
}

/* Very small devices (iPhone SE 1st gen, 320px) */
@media (max-width: 320px) {
    :root {
        --font-size-huge: 32px;
        --font-size-xxl: 24px;
        --font-size-xl: 20px;
        --font-size-lg: 16px;
        --spacing-lg: 16px;
        --spacing-xl: 24px;
    }

    .main-content {
        padding: var(--spacing-md) var(--spacing-sm);
    }

    .splash-logo {
        max-width: 240px;
    }
}

/* Small devices (iPhone SE 2nd/3rd gen, small Android, 375px) */
@media (max-width: 375px) {
    :root {
        --font-size-huge: 36px;
        --font-size-xxl: 28px;
        --font-size-xl: 20px;
    }

    .splash-logo {
        max-width: 280px;
    }
}

/* Standard small phones (iPhone 6/7/8, 414px and below) */
@media (max-width: 414px) {
    .splash-logo {
        max-width: 300px;
    }
}

/* Landscape orientation - compact UI */
    @media (max-height: 500px) and (orientation: landscape) {
        :root {
        --topbar-height: 60px;
        --navbar-height: 56px;
        --spacing-lg: 16px;
        --spacing-xl: 24px;
    }

    .main-content {
        padding: var(--spacing-md) var(--spacing-md);
        padding-bottom: calc(var(--navbar-height) + var(--spacing-md));
    }

    .splash-logo {
        max-width: 200px;
    }

    .splash-title {
        font-size: var(--font-size-xl);
    }

    .loading-spinner {
        width: 40px;
        height: 40px;
        margin-bottom: var(--spacing-md);
    }
}

/* Tablets and larger devices */
@media (min-width: 768px) {
    .main-content {
        padding: var(--spacing-xl) var(--spacing-lg);
        padding-bottom: calc(var(--navbar-height) + var(--spacing-xl));
    }
}

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

    .loading-spinner {
        animation: none;
        border-top-color: var(--color-primary);
    }
}
