/* ===========================================
   BASE.CSS - Mobile First Foundation
   Variables, Reset, Typography, Utilities
   =========================================== */

/* ===========================================
   CSS VARIABLES - Single Source of Truth
   =========================================== */

:root {
    /* Primary Colors */
    --primary: #00BFFF;
    --secondary: #191970;
    --accent: #32CD32;
    --navy: #191970;

    /* Extended Palette (from logo) */
    --sky-blue: #00BFFF;
    --orange: #FF4500;
    --purple: #8A2BE2;
    --pink: #FF1493;
    --green: #32CD32;

    /* Gradients */
    --gradient-main: linear-gradient(135deg, #00BFFF, #191970, #32CD32);
    --gradient-hover: linear-gradient(135deg, #32CD32, #191970, #00BFFF);
    --gradient-soft: linear-gradient(135deg, rgba(0,191,255,0.1), rgba(25,25,112,0.1), rgba(50,205,50,0.1));

    /* Text Colors */
    --text-dark: #2C3E50;
    --text-light: #5A6C7D;
    --text-muted: #95A5A6;

    /* Background Colors */
    --bg-white: #FFFFFF;
    --bg-light: #F8F9FA;
    --bg-section: #FAFBFC;

    /* Border Colors */
    --border-light: #E1E8ED;
    --border-dark: #CBD5E0;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.15);

    /* Typography Scale - Mobile First */
    --fs-xs: 0.75rem;
    --fs-sm: 0.875rem;
    --fs-base: 1rem;
    --fs-lg: 1.125rem;
    --fs-xl: 1.25rem;
    --fs-2xl: 1.5rem;
    --fs-3xl: 1.875rem;
    --fs-4xl: 2.25rem;
    --fs-5xl: 3rem;

    /* Spacing Scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;

    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-sticky: 500;
    --z-fixed: 900;
    --z-modal-backdrop: 1000;
    --z-modal: 1100;
    --z-popover: 1200;
    --z-tooltip: 1300;
}

/* ===========================================
   CSS RESET - Mobile First
   =========================================== */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Remove default styles */
a {
    text-decoration: none;
    color: inherit;
}

ul, ol {
    list-style: none;
}

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

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

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* ===========================================
   TYPOGRAPHY - Mobile First
   =========================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-dark);
}

/* Mobile sizes (base) */
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-base); }

p {
    margin-bottom: var(--space-md);
    color: var(--text-light);
}

/* ===========================================
   LAYOUT - Container
   =========================================== */

.container {
    width: 100%;
    padding: 0 var(--space-md);
    margin: 0 auto;
}

/* ===========================================
   UTILITY CLASSES
   =========================================== */

/* Text alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Display */
.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

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

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

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

.flex-wrap { flex-wrap: wrap; }

/* Gaps */
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* Margins */
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* Paddings */
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

/* ===========================================
   ANIMATIONS
   =========================================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.fade-in { animation: fadeIn var(--transition-slow); }
.fade-in-up { animation: fadeInUp var(--transition-slow); }
.slide-in-left { animation: slideInLeft var(--transition-slow); }

/* ===========================================
   ACCESSIBILITY
   =========================================== */

/* Focus styles */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: var(--space-sm) var(--space-md);
    z-index: 10000;
}

.skip-link:focus {
    top: 0;
}

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

    html {
        scroll-behavior: auto;
    }
}

/* ===========================================
   DARK MODE SUPPORT
   =========================================== */

body.dark-mode {
    --bg-white: #0a0a0a;
    --bg-light: #1a1a1a;
    --bg-section: #151515;
    --text-dark: #e0e0e0;
    --text-light: #b0b0b0;
    --border-light: #333333;
}

body.dark-mode .navbar {
    background: #1a1a1a;
}

body.dark-mode .card {
    background: #1a1a1a;
}
