/* Global Reset & Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600&family=Montserrat:wght@200;300;400;500&family=Philosopher:wght@400;700&display=swap');

:root {
    --bg-deep: #000000;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-hover: rgba(255, 255, 255, 0.08);
}

body {
    background-color: var(--bg-deep);
    color: var(--text-primary);
    font-family: 'Montserrat', sans-serif;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
.font-serif {
    font-family: 'Cinzel', serif;
}

/* Three.js Canvas Container */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    /* Let clicks pass through to UI */
}

/* UI Layer */
.ui-layer {
    position: relative;
    z-index: 10;
}

/* Glass Card Style */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    transition: all 0.4s ease;
}

.glass-card:hover {
    background: var(--glass-hover);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.05);
}

/* Cosmic Button */
.cosmic-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 1rem 3rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.cosmic-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: white;
    transition: width 0.3s ease;
    z-index: -1;
}

.cosmic-btn:hover {
    color: black;
    border-color: white;
}

.cosmic-btn:hover::before {
    width: 100%;
}

/* Navigation Overrides for High-End Look */
#mainNav {
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(10px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

#mainNav span,
#mainNav button {
    color: white !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    opacity: 0;
    animation: fadeIn 1s forwards;
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-500 {
    animation-delay: 0.5s;
}

/* Scroll Indicator */
.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, white, transparent);
    margin: 0 auto;
}

/* ===== LIGHT THEME STYLES (All 6 Modules) ===== */

/* Light Theme CSS Variables */
body.light-theme {
    --bg-deep: #ffffff;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --glass-border: rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-hover: rgba(255, 255, 255, 0.95);
    background-color: #ffffff;
    color: #111827;
}

/* Light Theme Navigation */
body.light-theme nav,
body.light-theme .glass-dark {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom-color: rgba(0, 0, 0, 0.1) !important;
}

body.light-theme nav span,
body.light-theme nav a,
body.light-theme nav button,
body.light-theme .glass-dark span,
body.light-theme .glass-dark a {
    color: #111827 !important;
}

body.light-theme nav a:hover,
body.light-theme .glass-dark a:hover {
    color: #3b82f6 !important;
}

/* Light Theme Main Content */
body.light-theme main {
    background: #ffffff;
}

/* Light Theme Body Background - Force white */
body.light-theme {
    background: #ffffff !important;
}

/* Light Theme Form Container */
body.light-theme main > div,
body.light-theme .max-w-4xl,
body.light-theme .max-w-3xl {
    background: transparent;
}

/* Light Theme Form Card/Container - White background */
body.light-theme form,
body.light-theme main .rounded-2xl,
body.light-theme main [class*="rounded-2xl"] {
    background: #ffffff !important;
}

body.light-theme h1,
body.light-theme h2,
body.light-theme h3,
body.light-theme h4 {
    color: #111827;
}

body.light-theme p,
body.light-theme span,
body.light-theme label {
    color: #374151;
}

body.light-theme .text-gray-300,
body.light-theme .text-gray-400 {
    color: #6b7280 !important;
}

body.light-theme .text-gray-500 {
    color: #9ca3af !important;
}

body.light-theme .text-gray-600 {
    color: #4b5563 !important;
}

body.light-theme .text-white {
    color: #111827 !important;
}

/* Light Theme Form Inputs */
body.light-theme input,
body.light-theme select,
body.light-theme textarea {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.2) !important;
    color: #111827 !important;
}

body.light-theme input::placeholder,
body.light-theme textarea::placeholder {
    color: #9ca3af !important;
}

body.light-theme input:focus,
body.light-theme select:focus,
body.light-theme textarea:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

/* Light Theme Form Labels */
body.light-theme .form-group label,
body.light-theme label.block {
    color: #111827 !important;
}

/* Light Theme Cards and Containers */
body.light-theme .glass-card,
body.light-theme [class*="rounded-2xl"][class*="border"],
body.light-theme [class*="rounded-xl"][class*="border"] {
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

body.light-theme .glass-card:hover {
    background: rgba(255, 255, 255, 1) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1) !important;
}

/* Light Theme Buttons */
body.light-theme button[type="submit"],
body.light-theme .cosmic-btn {
    background: transparent;
    border-color: rgba(59, 130, 246, 0.6) !important;
    color: #3b82f6 !important;
}

body.light-theme button[type="submit"]:hover,
body.light-theme .cosmic-btn:hover {
    background: #3b82f6 !important;
    color: #ffffff !important;
}

/* Light Theme Progress Indicator */
body.light-theme [id*="Circle"],
body.light-theme [id*="step"][id*="Circle"] {
    background: rgba(229, 231, 235, 0.8) !important;
}

body.light-theme [id*="connector"],
body.light-theme [class*="bg-gray-700"] {
    background: rgba(209, 213, 219, 0.5) !important;
}

/* Light Theme Accent Colors - Keep Vibrant */
body.light-theme .text-cyan-400,
body.light-theme .text-blue-400 {
    color: #0891b2 !important;
}

body.light-theme .text-indigo-400 {
    color: #4f46e5 !important;
}

body.light-theme .text-violet-400,
body.light-theme .text-purple-400 {
    color: #7c3aed !important;
}

body.light-theme .text-green-400 {
    color: #059669 !important;
}

body.light-theme .text-yellow-400 {
    color: #d97706 !important;
}

body.light-theme .text-red-400 {
    color: #dc2626 !important;
}

/* Light Theme Info Sections */
body.light-theme [class*="border-violet"],
body.light-theme [class*="border-cyan"],
body.light-theme [class*="border-blue"] {
    border-color: rgba(59, 130, 246, 0.2) !important;
}

/* Light Theme Feature Cards */
body.light-theme .grid > div[class*="rounded"] {
    background: rgba(255, 255, 255, 0.9) !important;
}

/* Light Theme Location Dropdown */
body.light-theme .location-dropdown,
body.light-theme [id*="LocationResults"] {
    background: #ffffff !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
}

body.light-theme .location-option {
    border-bottom-color: rgba(0, 0, 0, 0.1) !important;
}

body.light-theme .location-option:hover {
    background: rgba(59, 130, 246, 0.1) !important;
}

body.light-theme .location-option .city-name {
    color: #111827 !important;
}

body.light-theme .location-option .city-info {
    color: #6b7280 !important;
}

body.light-theme .timezone-badge {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #3b82f6 !important;
}

body.light-theme .coords-badge {
    background: rgba(124, 58, 237, 0.15) !important;
    color: #7c3aed !important;
}

/* ===== LIGHT THEME LOADING/GENERATING SCREENS ===== */

body.light-theme .generating-overlay,
body.light-theme [id*="LoadingOverlay"],
body.light-theme [id*="loadingOverlay"],
body.light-theme [class*="loading-overlay"] {
    background: rgba(255, 255, 255, 0.98) !important;
}

body.light-theme .generating-overlay *,
body.light-theme [id*="LoadingOverlay"] *,
body.light-theme [id*="loadingOverlay"] *,
body.light-theme [class*="loading-overlay"] * {
    color: #111827 !important;
}

body.light-theme .generating-overlay h2,
body.light-theme .generating-overlay h3,
body.light-theme [id*="LoadingOverlay"] h2,
body.light-theme [id*="LoadingOverlay"] h3 {
    color: #111827 !important;
}

body.light-theme .generating-overlay p,
body.light-theme [id*="LoadingOverlay"] p {
    color: #4b5563 !important;
}

/* Light Theme Spinner/Loading Animation */
body.light-theme .loading-spinner,
body.light-theme [class*="spinner"],
body.light-theme [class*="animate-spin"] {
    border-color: rgba(59, 130, 246, 0.2) !important;
    border-top-color: #3b82f6 !important;
}

/* ===== LIGHT THEME REPORT MODAL ===== */

/* Modal Overlay - Semi-transparent black */
body.light-theme .modal-overlay,
body.light-theme [class*="results-modal"],
body.light-theme [id*="ResultsModal"],
body.light-theme [class*="fixed"][class*="inset-0"][class*="bg-black"] {
    background: rgba(0, 0, 0, 0.6) !important;
}

/* Modal Content - White background with black text */
body.light-theme .modal-content,
body.light-theme [class*="modal-content"],
body.light-theme [class*="results-modal"] > div,
body.light-theme [id*="ResultsModal"] > div {
    background: #ffffff !important;
    color: #111827 !important;
}

body.light-theme .modal-content *,
body.light-theme [class*="modal-content"] * {
    color: #111827;
}

body.light-theme .modal-content h1,
body.light-theme .modal-content h2,
body.light-theme .modal-content h3,
body.light-theme .modal-content h4 {
    color: #111827 !important;
}

body.light-theme .modal-content p,
body.light-theme .modal-content span,
body.light-theme .modal-content li {
    color: #374151 !important;
}

/* Report Header in Modal */
body.light-theme .report-header,
body.light-theme [class*="report-header"] {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6) !important;
    color: #ffffff !important;
}

body.light-theme .report-header *,
body.light-theme [class*="report-header"] * {
    color: #ffffff !important;
}

/* Report Content Area */
body.light-theme .report-content-area,
body.light-theme [class*="report-content"] {
    background: #ffffff !important;
    color: #111827 !important;
}

body.light-theme .report-content-area h2,
body.light-theme .report-content-area h3 {
    color: #111827 !important;
    border-bottom-color: rgba(59, 130, 246, 0.2) !important;
}

body.light-theme .report-content-area p {
    color: #374151 !important;
}

/* Report Footer */
body.light-theme .report-footer,
body.light-theme [class*="report-footer"] {
    background: #f9fafb !important;
    border-top-color: rgba(0, 0, 0, 0.1) !important;
}

body.light-theme .report-footer button {
    color: #374151 !important;
}

body.light-theme .report-footer button:hover {
    background: rgba(59, 130, 246, 0.1) !important;
    color: #3b82f6 !important;
}

/* ===== LIGHT THEME CHAT WINDOW ===== */

body.light-theme [id*="ChatWindow"],
body.light-theme [class*="chat-window"] {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

body.light-theme [id*="ChatWindow"] *,
body.light-theme [class*="chat-window"] * {
    color: #111827;
}

body.light-theme .chat-message,
body.light-theme [class*="chat-message"] {
    background: #f3f4f6 !important;
    color: #111827 !important;
}

body.light-theme .chat-message.user,
body.light-theme [class*="chat-message"][class*="user"] {
    background: #3b82f6 !important;
    color: #ffffff !important;
}

body.light-theme .chat-input,
body.light-theme [id*="ChatInput"] {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.2) !important;
    color: #111827 !important;
}

/* ===== LIGHT THEME TYPING INDICATOR ===== */

body.light-theme .typing-indicator,
body.light-theme [class*="typing-indicator"] {
    background: rgba(243, 244, 246, 0.9) !important;
}

body.light-theme .typing-indicator .dot,
body.light-theme [class*="typing-indicator"] .dot {
    background: #3b82f6 !important;
}

/* ===== MOBILE RESPONSIVE FOR LIGHT THEME ===== */

@media (max-width: 768px) {
    body.light-theme nav {
        padding: 0.5rem 1rem;
    }

    body.light-theme .modal-content {
        border-radius: 0 !important;
        max-height: 100vh !important;
    }

    body.light-theme input,
    body.light-theme select,
    body.light-theme textarea {
        font-size: 16px !important; /* Prevent zoom on iOS */
    }
}

/* ===== THEME TOGGLE BUTTON STYLES ===== */

.theme-toggle-btn {
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
    background: rgba(59, 130, 246, 0.1);
}

body.light-theme .theme-toggle-btn {
    color: #3b82f6 !important;
    border-color: rgba(59, 130, 246, 0.5) !important;
}

body.light-theme .theme-toggle-btn:hover {
    background: rgba(59, 130, 246, 0.1) !important;
}

/* Sun/Moon Icon Toggle */
body.light-theme .sun-icon {
    display: none !important;
}

body.light-theme .moon-icon {
    display: inline-block !important;
}

body:not(.light-theme) .sun-icon {
    display: inline-block !important;
}

body:not(.light-theme) .moon-icon {
    display: none !important;
}