/**
 * PickFlix - Global Styles
 * Dark Color Scheme (Deep Navy/Slate)
 * Modern, clean, and cinematic design
 */

/* ========================================
   CSS VARIABLES - Dark Color Palette
   ======================================== */
:root {
    /* Primary Dark Colors */
    --color-bg-primary: #0f1419;      /* Deep Navy - Main background */
    --color-bg-secondary: #1a1f29;    /* Slate Blue - Cards/sections */
    --color-bg-tertiary: #252d3d;     /* Lighter slate - Hover states */
    --color-bg-elevated: #2a3441;     /* Elevated elements */
    
    /* Accent Colors */
    --color-accent-primary: #ff0a54;  /* Vibrant Pink/Red - Main CTA */
    --color-accent-secondary: #9333ea; /* Purple - Secondary actions */
    --color-accent-tertiary: #06b6d4; /* Cyan - Info/Links */
    --color-accent-success: #10b981;  /* Green - Success states */
    --color-accent-warning: #f59e0b;  /* Amber - Warnings */
    --color-accent-error: #ef4444;    /* Red - Errors */
    
    /* Text Colors */
    --color-text-primary: #f8fafc;    /* Almost white - Main text */
    --color-text-secondary: #cbd5e1;  /* Light gray - Secondary text */
    --color-text-tertiary: #94a3b8;   /* Medium gray - Muted text */
    --color-text-disabled: #64748b;   /* Dark gray - Disabled text */
    
    /* Border & Divider Colors */
    --color-border-primary: #334155;  /* Slate border */
    --color-border-secondary: #475569; /* Lighter border */
    --color-divider: rgba(148, 163, 184, 0.1);
    
    /* Overlay & Shadow Colors */
    --color-overlay: rgba(15, 20, 25, 0.85);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px rgba(255, 10, 84, 0.3);
    
    /* Gradient Backgrounds */
    --gradient-primary: linear-gradient(135deg, #ff0a54 0%, #9333ea 100%);
    --gradient-secondary: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --gradient-dark: linear-gradient(180deg, rgba(15, 20, 25, 0) 0%, rgba(15, 20, 25, 0.9) 100%);
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Fira Code', 'Courier New', monospace;
    
    /* Font Sizes */
    --text-xs: 0.75rem;    /* 12px */
    --text-sm: 0.875rem;   /* 14px */
    --text-base: 1rem;     /* 16px */
    --text-lg: 1.125rem;   /* 18px */
    --text-xl: 1.25rem;    /* 20px */
    --text-2xl: 1.5rem;    /* 24px */
    --text-3xl: 1.875rem;  /* 30px */
    --text-4xl: 2.25rem;   /* 36px */
    --text-5xl: 3rem;      /* 48px */
    
    /* Spacing */
    --spacing-xs: 0.25rem;  /* 4px */
    --spacing-sm: 0.5rem;   /* 8px */
    --spacing-md: 1rem;     /* 16px */
    --spacing-lg: 1.5rem;   /* 24px */
    --spacing-xl: 2rem;     /* 32px */
    --spacing-2xl: 3rem;    /* 48px */
    --spacing-3xl: 4rem;    /* 64px */
    
    /* 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;
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
    
    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
    background-image: 
        radial-gradient(circle at 20% 10%, rgba(147, 51, 234, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 90%, rgba(255, 10, 84, 0.05) 0%, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-md);
}

h1 { font-size: var(--text-5xl); letter-spacing: -0.02em; }
h2 { font-size: var(--text-4xl); letter-spacing: -0.01em; }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
    margin-bottom: var(--spacing-md);
    color: var(--color-text-secondary);
}

a {
    color: var(--color-accent-tertiary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-accent-primary);
}

strong, b {
    font-weight: 600;
    color: var(--color-text-primary);
}

small {
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
}

/* ========================================
   LAYOUT UTILITIES
   ======================================== */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.container-sm {
    max-width: 640px;
}

.container-md {
    max-width: 768px;
}

.container-lg {
    max-width: 1024px;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.75rem 1.5rem;
    font-size: var(--text-base);
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    outline: none;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

/* Secondary Button */
.btn-secondary {
    background-color: var(--color-bg-elevated);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border-primary);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--color-bg-tertiary);
    border-color: var(--color-border-secondary);
}

/* Outline Button */
.btn-outline {
    background-color: transparent;
    color: var(--color-accent-primary);
    border: 2px solid var(--color-accent-primary);
}

.btn-outline:hover:not(:disabled) {
    background-color: var(--color-accent-primary);
    color: white;
}

/* Ghost Button */
.btn-ghost {
    background-color: transparent;
    color: var(--color-text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background-color: var(--color-bg-tertiary);
    color: var(--color-text-primary);
}

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

.btn-lg {
    padding: 1rem 2rem;
    font-size: var(--text-lg);
}

.btn-icon {
    padding: 0.75rem;
    aspect-ratio: 1;
}

/* ========================================
   CARDS
   ======================================== */
.card {
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.card:hover {
    border-color: var(--color-border-secondary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--color-divider);
}

.card-title {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: 0;
}

.card-body {
    margin-bottom: var(--spacing-md);
}

.card-footer {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-divider);
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

/* ========================================
   FORMS
   ======================================== */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-sm);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: var(--text-base);
    font-family: inherit;
    color: var(--color-text-primary);
    background-color: var(--color-bg-tertiary);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-md);
    outline: none;
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--color-accent-primary);
    box-shadow: 0 0 0 3px rgba(255, 10, 84, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-disabled);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-error {
    display: block;
    font-size: var(--text-sm);
    color: var(--color-accent-error);
    margin-top: var(--spacing-xs);
}

.form-help {
    display: block;
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
    margin-top: var(--spacing-xs);
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: var(--color-accent-primary);
}

.form-check-label {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
    cursor: pointer;
}

/* ========================================
   BADGES & PILLS
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0.25rem 0.75rem;
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-primary {
    background-color: rgba(255, 10, 84, 0.15);
    color: var(--color-accent-primary);
}

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

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

.badge-info {
    background-color: rgba(6, 182, 212, 0.15);
    color: var(--color-accent-tertiary);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

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

/* Flex Utilities */
.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

/* Margins */
.m-0 { margin: 0 !important; }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

/* Padding */
.p-0 { padding: 0 !important; }
.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }

/* Width */
.w-full { width: 100%; }
.w-auto { width: auto; }

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid var(--color-bg-tertiary);
    border-top-color: var(--color-accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Fade In Animation */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

/* Slide Up Animation */
.slide-up {
    animation: slideUp 0.4s ease-out;
}

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

/* ========================================
   SCROLLBAR STYLING
   ======================================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--color-bg-elevated);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-border-secondary);
}

/* ========================================
   SELECTION
   ======================================== */
::selection {
    background-color: rgba(255, 10, 84, 0.3);
    color: var(--color-text-primary);
}

::-moz-selection {
    background-color: rgba(255, 10, 84, 0.3);
    color: var(--color-text-primary);
}

/* ========================================
   NAVBAR / NAVIGATION
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-fixed);
    background: rgba(15, 20, 25, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border-primary);
    box-shadow: var(--shadow-md);
    height: 70px; /* Fixed height for consistent spacing */
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-size: var(--text-2xl);
    font-weight: 700;
}

.nav-brand a {
    color: var(--color-text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color var(--transition-fast);
}

.nav-brand a:hover {
    color: var(--color-accent-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: var(--color-text-secondary);
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-text-primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width var(--transition-base);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Mobile Menu Toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
        z-index: calc(var(--z-fixed) + 1);
    }

    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: rgba(15, 20, 25, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        gap: 0;
        padding: 1rem;
        border-bottom: 1px solid var(--color-border-primary);
        box-shadow: var(--shadow-lg);
        display: none;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        width: 100%;
        padding: 1rem;
        border-bottom: 1px solid var(--color-divider);
    }

    .nav-links a:last-child {
        border-bottom: none;
    }

    .nav-links a::after {
        display: none;
    }
}
