/* ========================================
   VARIABLES & RESET
======================================== */
:root {
    /* Colors - Energetic paddle theme (Dark Mode Default) */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #10b981;
    --accent: #f59e0b;
    
    /* Theme Colors (Dark Mode) */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
    
    /* Legacy aliases for compatibility */
    --dark: #0f172a;
    --dark-light: #1e293b;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --light: #f1f5f9;
    --white: #ffffff;
    
    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    --gradient-glow: radial-gradient(circle at 50% 50%, rgba(37, 99, 235, 0.15) 0%, transparent 70%);
    
    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Spacing */
    --section-padding: 100px 0;
    --container-width: 1200px;
    
    /* Effects */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 40px rgba(37, 99, 235, 0.3);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --transition: all 0.3s ease;
}

/* Light Mode - Improved contrast and visibility */
[data-theme="light"] {
    /* Backgrounds */
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: #ffffff;
    
    /* Text - keeping dark colors for contrast */
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    
    /* Borders - more visible */
    --border-color: rgba(15, 23, 42, 0.12);
    --border-hover: rgba(15, 23, 42, 0.25);
    
    /* Shadows for depth */
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.1);
    --shadow-lg: 0 12px 24px rgba(15, 23, 42, 0.12);
    --shadow-card: 0 2px 8px rgba(15, 23, 42, 0.08), 0 0 1px rgba(15, 23, 42, 0.1);
    
    /* Keep these for proper contrast - DON'T invert text colors */
    --dark: var(--bg-primary);
    --dark-light: var(--bg-card);
    --gray: var(--text-muted);
    --gray-light: var(--text-secondary);
    --light: #0f172a;
    --white: var(--text-primary);
    
    /* Gradients for light mode */
    --gradient-hero: linear-gradient(135deg, #ffffff 0%, #f1f5f9 50%, #ffffff 100%);
    --gradient-glow: radial-gradient(circle at 50% 50%, rgba(37, 99, 235, 0.06) 0%, transparent 70%);
}

/* Light mode specific overrides for better visibility */
[data-theme="light"] .hero-bg {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

[data-theme="light"] .game-mockup {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

[data-theme="light"] .mockup-sidebar button,
[data-theme="light"] .mockup-sidebar .add-court {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

[data-theme="light"] .feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
}

[data-theme="light"] .step-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

[data-theme="light"] .faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

[data-theme="light"] .input-group input {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

[data-theme="light"] .input-group input::placeholder {
    color: var(--text-muted);
}

[data-theme="light"] .btn-primary {
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

[data-theme="light"] .modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

[data-theme="light"] footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--dark);
    color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ========================================
   HERO SECTION
======================================== */
.hero {
    min-height: 100vh;
    background: var(--gradient-hero);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: var(--gradient-glow);
    pointer-events: none;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-50px, 50px) rotate(180deg); }
}

/* Navigation */
.nav {
    padding: 24px 40px;
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-icon {
    font-size: 1.75rem;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

/* Language Selector - Dropdown with Flags */
.lang-selector {
    position: relative;
}

.lang-current {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-light);
}

.lang-current:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
}

.lang-current .flag {
    font-size: 1rem;
    line-height: 1;
}

.lang-current .arrow {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.lang-selector.open .lang-current .arrow {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--dark-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 100;
    overflow: hidden;
}

.lang-selector.open .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    color: var(--gray-light);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.lang-option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
}

.lang-option.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-light);
}

.lang-option .flag {
    font-size: 1.1rem;
}

.lang-option .lang-name {
    flex: 1;
}

.lang-option .lang-code {
    font-size: 0.75rem;
    color: var(--gray);
    text-transform: uppercase;
}

/* Light mode adjustments */
[data-theme="light"] .lang-current {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-secondary);
}

[data-theme="light"] .lang-current:hover {
    background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .lang-dropdown {
    background: var(--bg-card);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .lang-option {
    color: var(--text-secondary);
}

[data-theme="light"] .lang-option:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

/* Theme Toggle */
.theme-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
}

[data-theme="light"] .theme-toggle {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Hero Content */
.hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 24px 60px;
    position: relative;
    z-index: 5;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(37, 99, 235, 0.3);
    padding: 8px 20px;
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-light);
    margin-bottom: 24px;
    animation: pulse 2s ease-in-out infinite;
}

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

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    max-width: 800px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--white) 0%, var(--gray-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--gray-light);
    max-width: 600px;
    margin-bottom: 40px;
    line-height: 1.7;
}

/* Email Form */
.email-form {
    width: 100%;
    max-width: 500px;
}

.input-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 8px;
    transition: var(--transition);
}

.input-group:focus-within {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.input-group input {
    flex: 1;
    min-width: 200px;
    background: transparent;
    border: none;
    padding: 16px 20px;
    font-size: 1rem;
    color: var(--white);
    outline: none;
}

.input-group input::placeholder {
    color: var(--gray);
}

.input-group .btn-primary {
    flex-shrink: 0;
}

@media (max-width: 500px) {
    .input-group {
        flex-direction: column;
    }
    
    .input-group input {
        min-width: 100%;
    }
    
    .input-group .btn-primary {
        width: 100%;
        justify-content: center;
    }
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 16px 28px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

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

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

.form-note {
    font-size: 0.875rem;
    color: var(--gray);
    margin-top: 16px;
}

/* Social Proof */
.social-proof {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
    color: var(--gray-light);
    font-size: 0.9rem;
}

.avatars {
    display: flex;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--dark-light);
    border: 2px solid var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    margin-left: -8px;
}

.avatar:first-child {
    margin-left: 0;
}

/* Hero Visual / Mockup */
.hero-visual {
    display: none;
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
}

@media (min-width: 1200px) {
    .hero-content {
        align-items: flex-start;
        text-align: left;
        padding-left: 80px;
        max-width: 650px;
    }
    
    .hero-visual {
        display: block;
    }
}

.mockup-container {
    perspective: 1000px;
}

.mockup-screen {
    background: var(--dark-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 24px;
    width: 400px;
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    transform: rotateY(-5deg) rotateX(5deg);
    animation: mockup-float 6s ease-in-out infinite;
}

@keyframes mockup-float {
    0%, 100% { transform: rotateY(-5deg) rotateX(5deg) translateY(0); }
    50% { transform: rotateY(-5deg) rotateX(5deg) translateY(-10px); }
}

.mockup-header {
    display: flex;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
    font-weight: 600;
}

.mockup-day {
    color: var(--gray-light);
}

.mockup-money {
    color: var(--secondary);
}

.mockup-rating {
    color: var(--accent);
}

.mockup-courts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.court {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    font-size: 0.9rem;
}

.court.indoor {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.3);
}

.court-empty {
    background: rgba(255, 255, 255, 0.03);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
}

.court-empty:hover {
    border-color: var(--primary);
    color: var(--primary-light);
}

.mockup-stats {
    display: flex;
    gap: 24px;
}

.stat {
    flex: 1;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray);
}

/* ========================================
   FEATURES SECTION
======================================== */
.features {
    padding: var(--section-padding);
    background: var(--dark);
}

.features h2,
.how-it-works h2,
.faq h2,
.final-cta h2 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
}

.section-subtitle {
    text-align: center;
    color: var(--gray-light);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 60px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--dark-light);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: var(--transition);
}

.feature-card:hover {
    border-color: rgba(37, 99, 235, 0.3);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--gray-light);
    line-height: 1.7;
}

/* ========================================
   HOW IT WORKS
======================================== */
.how-it-works {
    padding: var(--section-padding);
    background: linear-gradient(180deg, var(--dark) 0%, var(--dark-light) 100%);
}

.steps {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 60px;
}

.step {
    text-align: center;
    max-width: 200px;
}

.step-number {
    width: 48px;
    height: 48px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 auto 16px;
}

.step h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.step p {
    font-size: 0.9rem;
    color: var(--gray-light);
}

.step-arrow {
    font-size: 1.5rem;
    color: var(--gray);
    margin-top: 16px;
}

@media (max-width: 768px) {
    .step-arrow {
        display: none;
    }
    
    .steps {
        flex-direction: column;
        align-items: center;
    }
    
    .step {
        max-width: 280px;
    }
}

/* ========================================
   FAQ SECTION
======================================== */
.faq {
    padding: var(--section-padding);
    background: var(--dark-light);
}

.faq-list {
    max-width: 700px;
    margin: 60px auto 0;
}

.faq-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    overflow: hidden;
}

.faq-item summary {
    padding: 20px 24px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
    transition: var(--transition);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--gray);
    transition: var(--transition);
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item summary:hover {
    background: rgba(255, 255, 255, 0.02);
}

.faq-item p {
    padding: 0 24px 20px;
    color: var(--gray-light);
    line-height: 1.7;
}

/* ========================================
   FINAL CTA
======================================== */
.final-cta {
    padding: var(--section-padding);
    background: var(--gradient-hero);
    text-align: center;
}

.final-cta p {
    color: var(--gray-light);
    margin-bottom: 32px;
}

.final-cta .email-form {
    margin: 0 auto;
}

.final-cta .input-group {
    flex-wrap: wrap;
}

.final-cta .btn-primary {
    flex: 1;
    min-width: 200px;
    justify-content: center;
}

/* ========================================
   FOOTER
======================================== */
.footer {
    padding: 40px 0;
    background: var(--dark);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.footer-links {
    display: flex;
    gap: 32px;
}

.footer-links a {
    color: var(--gray-light);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--white);
}

.copyright {
    font-size: 0.875rem;
    color: var(--gray);
}

/* ========================================
   MODAL
======================================== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--dark-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 48px;
    max-width: 450px;
    text-align: center;
    animation: modal-in 0.3s ease-out;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.modal-content h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.modal-content p {
    color: var(--gray-light);
    margin-bottom: 24px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    color: var(--primary-light);
    border: 2px solid var(--primary);
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    width: 100%;
    margin-bottom: 16px;
}

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

.modal-close {
    background: none;
    border: none;
    color: var(--gray);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 8px;
}

.modal-close:hover {
    color: var(--white);
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 640px) {
    .input-group {
        flex-direction: column;
        padding: 12px;
    }
    
    .input-group input {
        text-align: center;
    }
    
    .btn-primary {
        width: 100%;
        justify-content: center;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}
