/* ================================================================
   WEBAPPTOWN UNIFIED DESIGN SYSTEM
   Apple-Inspired | Minimalist | Professional
   ================================================================ */

:root {
    /* ============================================================
       COLOR PALETTE
       ============================================================ */
    
    /* Primary Colors - WebAppTown Brand */
    --brand-teal: #2A9D8F;
    --brand-gold: #E9C46A;
    --primary-blue: #2A9D8F;
    --electric-cyan: #2A9D8F;
    
    /* Secondary Colors */
    --success-green: #10B981;
    --warning-amber: #E9C46A;
    --danger-red: #EF4444;
    --info-purple: #8B5CF6;
    
    /* Shared Colors */
    --shared-dark: #2C3E50;
    --shared-light: #F8F9FA;
    
    /* Neutral Grays */
    --slate-50: #F8F9FA;
    --slate-100: #F1F5F9;
    --slate-200: #E2E8F0;
    --slate-300: #CBD5E1;
    --slate-400: #94A3B8;
    --slate-500: #64748B;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1E293B;
    --slate-900: #2C3E50;
    
    /* Semantic Colors */
    --text-primary: var(--slate-900);
    --text-secondary: var(--slate-600);
    --text-tertiary: var(--slate-500);
    --text-inverse: #FFFFFF;
    
    --bg-primary: #FFFFFF;
    --bg-secondary: var(--slate-50);
    --bg-tertiary: var(--slate-100);
    
    --border-light: var(--slate-200);
    --border-medium: var(--slate-300);
    --border-dark: var(--slate-400);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--brand-teal) 0%, var(--brand-gold) 100%);
    --gradient-hero: linear-gradient(135deg, var(--shared-dark) 0%, var(--brand-teal) 50%, var(--brand-gold) 100%);
    --gradient-card: linear-gradient(135deg, var(--shared-dark) 0%, var(--brand-teal) 100%);
    --gradient-overlay: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.7));
    
    /* ============================================================
       TYPOGRAPHY
       ============================================================ */
    
    /* Font Families */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    --font-display: 'Space Grotesk', var(--font-primary);
    
    /* Font Sizes - Fluid Typography */
    --text-xs: clamp(0.75rem, 0.7rem + 0.2vw, 0.875rem);      /* 12-14px */
    --text-sm: clamp(0.875rem, 0.8rem + 0.3vw, 1rem);         /* 14-16px */
    --text-base: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);      /* 16-18px */
    --text-lg: clamp(1.125rem, 1rem + 0.5vw, 1.25rem);        /* 18-20px */
    --text-xl: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);        /* 20-24px */
    --text-2xl: clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem);      /* 24-30px */
    --text-3xl: clamp(1.875rem, 1.6rem + 1vw, 2.25rem);       /* 30-36px */
    --text-4xl: clamp(2.25rem, 1.8rem + 1.5vw, 3rem);         /* 36-48px */
    --text-5xl: clamp(3rem, 2.4rem + 2vw, 3.75rem);           /* 48-60px */
    --text-6xl: clamp(3.75rem, 3rem + 2.5vw, 4.5rem);         /* 60-72px */
    
    /* Font Weights */
    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
    --weight-extrabold: 800;
    --weight-black: 900;
    
    /* Line Heights */
    --leading-tight: 1.2;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 1.75;
    
    /* Letter Spacing */
    --tracking-tight: -0.02em;
    --tracking-normal: 0;
    --tracking-wide: 0.025em;
    --tracking-wider: 0.05em;
    
    /* ============================================================
       SPACING SYSTEM (8px base)
       ============================================================ */
    
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */
    --space-24: 6rem;     /* 96px */
    --space-32: 8rem;     /* 128px */
    --space-40: 10rem;    /* 160px */
    
    /* Section Spacing */
    --section-padding-sm: var(--space-12);
    --section-padding-md: var(--space-16);
    --section-padding-lg: var(--space-20);
    --section-padding-xl: var(--space-24);
    
    /* ============================================================
       BORDER RADIUS
       ============================================================ */
    
    --radius-sm: 0.375rem;   /* 6px */
    --radius-md: 0.5rem;     /* 8px */
    --radius-lg: 0.75rem;    /* 12px */
    --radius-xl: 1rem;       /* 16px */
    --radius-2xl: 1.5rem;    /* 24px */
    --radius-full: 9999px;   /* Full rounded */
    
    /* ============================================================
       SHADOWS
       ============================================================ */
    
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.15);
    
    --shadow-primary: 0 10px 20px rgba(46, 125, 255, 0.15);
    --shadow-success: 0 10px 20px rgba(16, 185, 129, 0.15);
    --shadow-warning: 0 10px 20px rgba(245, 158, 11, 0.15);
    --shadow-danger: 0 10px 20px rgba(239, 68, 68, 0.15);
    
    /* ============================================================
       TRANSITIONS & ANIMATIONS
       ============================================================ */
    
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 600ms cubic-bezier(0.4, 0, 0.2, 1);
    
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    
    /* ============================================================
       Z-INDEX LAYERS
       ============================================================ */
    
    --z-base: 1;
    --z-dropdown: 1000;
    --z-sticky: 1100;
    --z-fixed: 1200;
    --z-modal-backdrop: 1300;
    --z-modal: 1400;
    --z-popover: 1500;
    --z-tooltip: 1600;
    
    /* ============================================================
       BREAKPOINTS (for reference in JS)
       ============================================================ */
    
    --breakpoint-sm: 640px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1280px;
    --breakpoint-2xl: 1536px;
}

/* ================================================================
   GLOBAL RESET & BASE STYLES
   ================================================================ */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    font-weight: var(--weight-regular);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--bg-primary);
}

/* ================================================================
   TYPOGRAPHY UTILITIES
   ================================================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--weight-extrabold);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--text-primary);
    margin-bottom: var(--space-4);
}

h1 {
    font-size: var(--text-6xl);
    font-weight: var(--weight-black);
}

h2 {
    font-size: var(--text-5xl);
}

h3 {
    font-size: var(--text-4xl);
}

h4 {
    font-size: var(--text-3xl);
}

h5 {
    font-size: var(--text-2xl);
}

h6 {
    font-size: var(--text-xl);
}

p {
    margin-bottom: var(--space-4);
    line-height: var(--leading-relaxed);
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--electric-cyan);
}

strong, b {
    font-weight: var(--weight-bold);
}

em, i {
    font-style: italic;
}

/* ================================================================
   CONTAINER & LAYOUT
   ================================================================ */

.container {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}

@media (min-width: 640px) {
    .container {
        padding-left: var(--space-6);
        padding-right: var(--space-6);
    }
}

@media (min-width: 1024px) {
    .container {
        padding-left: var(--space-8);
        padding-right: var(--space-8);
    }
}

.container-wide {
    max-width: 1536px;
}

.container-narrow {
    max-width: 960px;
}

/* Section Padding */
.section {
    padding-top: var(--section-padding-lg);
    padding-bottom: var(--section-padding-lg);
}

@media (min-width: 1024px) {
    .section {
        padding-top: var(--section-padding-xl);
        padding-bottom: var(--section-padding-xl);
    }
}

/* ================================================================
   BUTTON COMPONENTS
   ================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-5);
    font-family: var(--font-primary);
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    line-height: 1;
    text-align: center;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(46, 125, 255, 0.3);
}

/* Button Sizes */
.btn-sm {
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-sm);
}

.btn-lg {
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
}

.btn-xl {
    padding: var(--space-5) var(--space-12);
    font-size: var(--text-xl);
}

/* Button Variants */
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(46, 125, 255, 0.25);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.btn-secondary:hover {
    background: var(--primary-blue);
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.btn-outline:hover {
    background: var(--slate-100);
    border-color: var(--slate-400);
}

.btn-ghost {
    background: transparent;
    color: var(--primary-blue);
}

.btn-ghost:hover {
    background: rgba(46, 125, 255, 0.1);
}

/* Button States */
.btn-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
}

/* ================================================================
   CARD COMPONENTS
   ================================================================ */

.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.card-title {
    font-size: var(--text-2xl);
    font-weight: var(--weight-bold);
    margin-bottom: var(--space-3);
}

.card-description {
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
}

/* Card Variants */
.card-gradient {
    background: var(--gradient-card);
    color: white;
    border: none;
}

.card-gradient .card-title,
.card-gradient .card-description {
    color: white;
}

.card-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ================================================================
   BADGE COMPONENTS
   ================================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-primary {
    background: rgba(46, 125, 255, 0.1);
    color: var(--primary-blue);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-green);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-amber);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-red);
}

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

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

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

.font-normal { font-weight: var(--weight-regular); }
.font-medium { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold { font-weight: var(--weight-bold); }
.font-extrabold { font-weight: var(--weight-extrabold); }
.font-black { font-weight: var(--weight-black); }

/* Background Utilities */
.bg-primary { background-color: var(--bg-primary); }
.bg-secondary { background-color: var(--bg-secondary); }
.bg-tertiary { background-color: var(--bg-tertiary); }

.bg-gradient-primary { background: var(--gradient-primary); }
.bg-gradient-hero { background: var(--gradient-hero); }
.bg-gradient-card { background: var(--gradient-card); }

/* Flexbox Utilities */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Grid Utilities */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Spacing Utilities */
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }

/* Responsive Utilities */
@media (max-width: 767px) {
    .hidden-mobile { display: none; }
}

@media (min-width: 768px) {
    .hidden-desktop { display: none; }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 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;
        scroll-behavior: auto !important;
    }
}

