/**
 * Grounded Ascension - Modern Unified Theme System
 * Ultra-modern, sleek, professional design with light/dark mode support
 * Balanced colors - not too bright, not too dark
 */

/* ========================================================================
   CSS Variables - Light & Dark Themes
   ======================================================================== */

:root {
    /* Light Theme - Elegant and Professional */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-elevated: #ffffff;
    --bg-overlay: rgba(0, 0, 0, 0.5);

    /* Text Colors - High Contrast for Readability */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-inverse: #ffffff;

    /* Accent Colors - Vibrant but Professional */
    --accent-primary: #3b82f6;
    --accent-primary-hover: #2563eb;
    --accent-secondary: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-info: #06b6d4;
    --accent-purple: #8b5cf6;

    /* Gradients - Modern and Eye-Catching */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

    /* Borders */
    --border-primary: #e2e8f0;
    --border-secondary: #cbd5e1;
    --border-muted: #94a3b8;

    /* Shadows - Subtle but Effective */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Component Specific */
    --card-bg: var(--bg-secondary);
    --input-bg: var(--bg-secondary);
    --navbar-bg: rgba(255, 255, 255, 0.95);
    --footer-bg: #1e293b;
}

/* Dark Theme - Balanced, Not Too Dark */
[data-theme="dark"] {
    --bg-primary: #1e293b;
    --bg-secondary: #334155;
    --bg-tertiary: #475569;
    --bg-elevated: #3b4556;
    --bg-overlay: rgba(0, 0, 0, 0.7);

    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-inverse: #0f172a;

    --accent-primary: #60a5fa;
    --accent-primary-hover: #3b82f6;
    --accent-secondary: #34d399;
    --accent-warning: #fbbf24;
    --accent-danger: #f87171;
    --accent-info: #22d3ee;
    --accent-purple: #a78bfa;

    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --gradient-hero: linear-gradient(135deg, #1e293b 0%, #334155 100%);

    --border-primary: #475569;
    --border-secondary: #64748b;
    --border-muted: #94a3b8;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.5);

    --card-bg: var(--bg-secondary);
    --input-bg: var(--bg-tertiary);
    --navbar-bg: rgba(30, 41, 59, 0.95);
    --footer-bg: #0f172a;
}

/* ========================================================================
   Base Styles
   ======================================================================== */

* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================================================
   Typography
   ======================================================================== */

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

p, .lead {
    color: var(--text-secondary);
}

small, .small {
    color: var(--text-muted);
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* ========================================================================
   Navigation
   ======================================================================== */

.navbar {
    background: var(--navbar-bg) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-primary);
    box-shadow: var(--shadow-sm);
    /* Ensure navbar and its collapsed menu stack above page content */
    position: sticky;
    top: 0;
    z-index: 1030;
}

.navbar-brand {
    color: var(--text-primary) !important;
    font-weight: 800;
    font-size: 1.5rem;
}

.navbar-brand:hover {
    color: var(--accent-primary) !important;
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 600;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-primary) !important;
    background: rgba(59, 130, 246, 0.1);
}

.navbar-toggler {
    border-color: var(--border-primary);
}

[data-theme="dark"] .navbar-toggler-icon {
    filter: invert(1);
}

/* Make sure collapsed navigation and dropdowns appear above cards */
.navbar .navbar-collapse { z-index: 1030; }
.navbar .dropdown-menu { z-index: 1050; }

/* ========================================================================
   Cards
   ======================================================================== */

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

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

.card-header {
    background: var(--gradient-primary);
    color: white;
    border-bottom: none;
    font-weight: 700;
    padding: 1.25rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    color: var(--text-primary);
    font-weight: 700;
}

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

/* Phase Cards */
.phase-card {
    border: 2px solid var(--border-primary);
    transition: all 0.3s ease;
}

.phase-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-8px);
}

/* ========================================================================
   Buttons
   ======================================================================== */

.btn {
    font-weight: 600;
    border-radius: 10px;
    padding: 0.625rem 1.5rem;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    filter: brightness(1.1);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
}

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

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

.btn-outline-light {
    border: 2px solid white;
    color: white;
    background: transparent;
}

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

.btn-light {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

/* ========================================================================
   Modal (match theme background and text colors)
   ======================================================================== */
.modal-content {
    background-color: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-xl);
}

.modal-header,
.modal-footer {
    border-color: var(--border-primary);
}

.modal-title {
    color: var(--text-primary);
}

.modal-body {
    color: var(--text-secondary);
}

[data-theme="dark"] .btn-close {
    filter: invert(1);
}

[data-theme="light"] .btn-close {
    filter: invert(0);
}

.modal-body code {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
}

/* ========================================================================
   Forms
   ======================================================================== */

.form-control,
.form-select {
    background-color: var(--input-bg);
    border: 2px solid var(--border-primary);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--input-bg);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-check-input {
    background-color: var(--input-bg);
    border: 2px solid var(--border-primary);
}

.form-check-input:checked {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.form-check-label {
    color: var(--text-secondary);
}

/* ========================================================================
   Hero Section
   ======================================================================== */

.hero-section {
    background: var(--gradient-hero) !important;
    padding: 5rem 0 !important;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.05)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,138.7C960,139,1056,117,1152,112C1248,107,1344,117,1392,122.7L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
    opacity: 0.1;
}

.hero-section * {
    position: relative;
    z-index: 1;
}

/* Hero Headline Styling */
.hero-headline {
    font-size: clamp(1.75rem, 4.5vw, 3.5rem);
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: white;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4),
                 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
}

.headline-line {
    display: block;
    white-space: nowrap;
    animation: fadeInUp 0.8s ease-out backwards;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 0.25rem 0;
}

/* Ensure headline fits on smaller screens */
@media (max-width: 1200px) {
    .hero-headline {
        font-size: clamp(1.5rem, 4vw, 3rem);
    }
}

@media (max-width: 992px) {
    .hero-headline {
        font-size: clamp(1.5rem, 5vw, 2.5rem);
    }
}

@media (max-width: 576px) {
    .hero-headline {
        font-size: 1.65rem;
    }

    .headline-line {
        white-space: normal;
    }
}

.headline-line:first-child {
    animation-delay: 0.1s;
}

.headline-line:last-child {
    animation-delay: 0.3s;
    background: linear-gradient(135deg, #ffd700 0%, #ffffff 50%, #ffd700 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.3));
    animation: fadeInUp 0.8s ease-out 0.3s backwards, shimmer 3s linear infinite;
}

/* Add subtle glow effect on hover */
.hero-headline:hover .headline-line:last-child {
    filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.5));
    transition: filter 0.3s ease;
}

/* Shimmer animation for the golden wealth line */
@keyframes shimmer {
    0%, 100% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
}

/* ========================================================================
   Alerts & Badges
   ======================================================================== */

.alert {
    border-radius: 12px;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--accent-danger);
    color: var(--accent-danger);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--accent-warning);
    color: var(--accent-warning);
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    border-color: var(--accent-info);
    color: var(--accent-info);
}

.badge {
    font-weight: 600;
    padding: 0.5em 1em;
    border-radius: 20px;
}

/* ========================================================================
   Progress Bars
   ======================================================================== */

.progress {
    background-color: var(--bg-tertiary);
    border-radius: 10px;
    height: 12px;
}

.progress-bar {
    background: var(--gradient-primary);
    border-radius: 10px;
}

/* ========================================================================
   Footer
   ======================================================================== */

footer {
    background: var(--footer-bg) !important;
    color: var(--text-inverse) !important;
    padding: 2rem 0;
    border-top: 1px solid var(--border-primary);
}

footer p, footer small {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* ========================================================================
   Theme Toggle Button
   ======================================================================== */

.theme-toggle-btn {
    background: transparent;
    border: 2px solid var(--border-primary);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: rotate(20deg);
}

/* ========================================================================
   Video Container
   ======================================================================== */

.video-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-2xl);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.4);
}

.video-container video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 20px;
}

/* Ensure embedded iframes inside video container render reliably */
.video-container iframe {
    width: 100%;
    height: auto;
    min-height: 300px;
    display: block;
    border-radius: 20px;
}

/* Unmute overlay styling */
.unmute-overlay {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    cursor: pointer;
    backdrop-filter: blur(6px);
    z-index: 2;
}

.unmute-overlay:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* ========================================================================
   Stats Section
   ======================================================================== */

.stat-card {
    padding: 2rem 1rem;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-10px);
}

.stat-card h2 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.stat-card p {
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.stat-card small {
    font-size: 0.875rem;
}

/* ========================================================================
   Utility Classes
   ======================================================================== */

.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }

.bg-light {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

.bg-dark {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

/* ========================================================================
   Animations
   ======================================================================== */

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

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

/* ========================================================================
   Responsive Design
   ======================================================================== */

@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0 !important;
    }

    .card {
        margin-bottom: 1rem;
    }

    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    .video-container {
        max-width: 100%;
        margin-top: 2rem;
    }
}

/* ========================================================================
   Print Styles
   ======================================================================== */

@media print {
    .navbar,
    .theme-toggle-btn,
    footer {
        display: none;
    }

    body {
        background: white;
        color: black;
    }
}
/* Ensure readonly inputs match theme (Bootstrap sets a light background) */
.form-control[readonly],
.form-control:read-only {
    background-color: var(--input-bg);
    color: var(--text-primary);
    opacity: 1;
}
