/* Custom CSS for HandWriting Analysis Web App */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Prevent layout shift when scrollbar appears/disappears between pages */
html {
    scrollbar-gutter: stable;
}

body {
    overflow-y: scroll;
}

/* Custom animations */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Custom gradient backgrounds */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Custom card styles */
.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* File upload area */
.upload-area {
    border: 2px dashed #d1d5db;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #6366f1;
    background-color: #f8fafc;
}

.upload-area.dragover {
    border-color: #4f46e5;
    background-color: #eef2ff;
}

/* Analysis result cards */
.result-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.result-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Credit purchase cards */
.credit-package {
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.credit-package:hover {
    border-color: #6366f1;
    box-shadow: 0 8px 25px -8px rgba(99, 102, 241, 0.3);
}

.credit-package.popular {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

/* Loading states */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive text */
@media (max-width: 768px) {
    .text-5xl { font-size: 2.5rem; }
    .text-4xl { font-size: 2rem; }
    .text-3xl { font-size: 1.75rem; }
}

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Progress bar */
.progress-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    transition: width 0.3s ease;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    max-width: 400px;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.notification.success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.notification.error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.notification.warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.notification.info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

/* Horoscope modal styling */
.gradient-card {
    box-shadow: 0 12px 24px -18px rgba(15, 23, 42, 0.4);
}

.horoscope-section-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

/* Reduce header CLS by reserving space for auth controls */
#navbar #login-btn.hidden,
#navbar #user-menu.hidden,
#navbar #credits-display.hidden {
    display: inline-flex !important;
    visibility: hidden;
    pointer-events: none;
}

#navbar #user-menu.hidden #user-dropdown {
    display: none !important;
}

/* Initial auth-state layout stabilization */
html[data-auth="logged-in"] #home {
    display: none;
}

html[data-auth="logged-in"] #app-container {
    display: block !important;
}

html[data-auth="guest"] #app-container {
    display: none !important;
}

html[data-auth="logged-in"] .guest-only {
    display: none !important;
}

html[data-auth="guest"] .auth-only {
    display: none !important;
}

/* Navigation link styling with animated underline */
#navbar .nav-links a {
    position: relative;
    padding: 0.5rem 0.25rem;
    transition: color 0.3s ease;
}

#navbar .nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2.5px;
    background-color: #4f46e5;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
    border-radius: 99px;
    opacity: 0;
}

.dark #navbar .nav-links a::after {
    background-color: #fcd34d;
}

#navbar .nav-links a:hover::after {
    width: 50%;
    opacity: 0.5;
}

#navbar .nav-links a.is-active {
    color: #4f46e5 !important;
    font-weight: 700 !important;
}

.dark #navbar .nav-links a.is-active {
    color: #fcd34d !important;
    font-weight: 700 !important;
}

#navbar .nav-links a.is-active::after {
    width: 100%;
    opacity: 1;
}

#navbar .nav-links a.is-active:hover::after {
    width: 100%;
    opacity: 1;
}

@media (min-width: 768px) {
    #navbar .nav-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        align-items: center;
    }

    #navbar .nav-links {
        justify-self: center;
    }

    #navbar .nav-actions {
        justify-self: end;
        display: flex;
        align-items: center;
        gap: 1rem;
        min-width: 220px;
    }
}

#mobile-menu a.is-active {
    background-color: rgba(99, 102, 241, 0.08) !important;
    color: #4f46e5 !important;
    font-weight: 600;
}

.dark #mobile-menu a.is-active {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #fcd34d !important;
    font-weight: 600;
}

/* Analysis type selection */
.analysis-type-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.analysis-type-card:hover {
    border-color: #6366f1;
    box-shadow: 0 8px 25px -8px rgba(99, 102, 241, 0.3);
}

.analysis-type-card.selected {
    border-color: #6366f1;
    background: #eef2ff;
}

/* Horoscope card */
.horoscope-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.horoscope-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .notification {
        left: 20px;
        right: 20px;
        max-width: none;
    }
    
    .upload-area {
        min-height: 200px;
    }
    
    .result-card {
        margin: 0 10px;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .result-card {
        box-shadow: none;
        border: 1px solid #e5e7eb;
        page-break-inside: avoid;
    }
}
/* Inline styles migrated from index.html */
.emoji-flag {
            font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'EmojiSymbols', sans-serif !important;
            font-feature-settings: 'liga';
            font-variant-emoji: emoji;
            display: inline-block;
            width: 1em;
            height: 1em;
            line-height: 1;
            text-align: center;
        }
        
        /* Ensure all flag elements render properly */
        #current-language-flag, 
        #mobile-current-language-flag,
        .language-option .emoji-flag,
        .language-option span[class*="flag"] {
            font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'EmojiSymbols', sans-serif !important;
            font-feature-settings: 'liga';
            font-variant-emoji: emoji;
            display: inline-block;
            line-height: 1;
            text-align: center;
        }
        
        /* Force emoji rendering for language modal */
        .language-option .emoji-flag {
            font-size: 24px !important;
            width: 24px;
            height: 24px;
            line-height: 24px;
        }
        
        /* Desktop dropdown styling */
        #user-dropdown {
            z-index: 1000;
        }
        
        #user-dropdown.hidden {
            display: none;
        }
        
        #user-dropdown:not(.hidden) {
            display: block;
        }
        
        /* Mobile-specific improvements */
        @media (max-width: 768px) {
            /* Responsive text sizing for long Norwegian words */
            h1 {
                font-size: 2.5rem !important; /* Reduce from text-6xl to prevent overflow */
                line-height: 1.1 !important;
                word-wrap: break-word;
                hyphens: auto;
                overflow-wrap: break-word;
            }
            
            /* Specific targeting for hero section text */
            h1 .text-gray-800[data-translate="handwritingAnalysis"] {
                font-size: 2.25rem !important; /* Even smaller for the long Norwegian compound word */
                line-height: 1.1 !important;
                word-break: break-word;
                hyphens: auto;
            }
            
            /* Ensure Downloads page headings are also responsive */
            #downloads-hero h1 {
                font-size: 2.5rem !important;
                line-height: 1.1 !important;
                word-wrap: break-word;
                hyphens: auto;
            }
            
            /* Additional text responsiveness for long compound words */
            h2, h3 {
                word-wrap: break-word;
                hyphens: auto;
                overflow-wrap: break-word;
            }
            
            /* Prevent horizontal overflow on mobile */
            body {
                overflow-x: hidden;
            }
            
            /* Ensure containers don't exceed viewport width */
            .max-w-7xl, .max-w-4xl, .max-w-3xl {
                max-width: calc(100vw - 2rem) !important;
                margin-left: auto;
                margin-right: auto;
            }
        }
        
        /* Extra small mobile devices (phones) */
        @media (max-width: 480px) {
            /* Further reduce text size for very small screens */
            h1 {
                font-size: 2rem !important; /* Even smaller on phones */
                line-height: 1.1 !important;
            }
            
            /* Specifically handle the Norwegian compound word */
            h1 .text-gray-800[data-translate="handwritingAnalysis"] {
                font-size: 1.875rem !important; /* 30px equivalent, smaller for Norwegian */
                line-height: 1.1 !important;
            }
            
            /* Downloads page for phones */
            #downloads-hero h1 {
                font-size: 2rem !important;
                line-height: 1.1 !important;
            }
            
            /* Adjust paragraph text for better readability */
            .text-xl {
                font-size: 1.125rem !important; /* Reduce from text-xl */
                line-height: 1.4 !important;
            }
            
            /* Ensure padding doesn't cause overflow */
            .px-4 {
                padding-left: 1rem !important;
                padding-right: 1rem !important;
            }
            
            /* Ensure proper touch targets on mobile */
            .mobile-touch-target {
                min-height: 44px;
                display: flex;
                align-items: center;
            }
            
            /* Improve mobile modal display */
            .fixed.inset-0 {
                padding: 16px;
            }
            
            /* Mobile menu improvements */
            #mobile-menu {
                max-height: calc(100vh - 64px);
                overflow-y: auto;
            }
            
            /* Better spacing for mobile user section */
            #mobile-user-section {
                margin-top: 8px;
                padding-top: 8px;
            }
            
            /* Ensure mobile buttons are properly sized */
            #mobile-menu button {
                min-height: 44px;
                touch-action: manipulation;
            }
            
            /* Fix modal sizing on mobile */
            .modal-body {
                max-height: 70vh;
                overflow-y: auto;
            }
            
            /* Improve touch interaction */
            button, a {
                touch-action: manipulation;
            }
            
            /* Fix header z-index issues on mobile */
            nav {
                z-index: 100;
            }
            
            /* Hide desktop dropdown on mobile - use mobile menu instead */
            /* Note: This rule is now properly scoped to mobile only */
            
            /* Hide desktop dropdown and user menu button on mobile */
            #user-dropdown {
                display: none !important;
            }
            
            #user-menu {
                display: none !important;
            }
            
            /* Ensure mobile menu is accessible */
            #mobile-menu {
                touch-action: manipulation;
            }
            
            /* Make mobile menu items more touchable */
            #mobile-menu button,
            #mobile-menu a {
                min-height: 48px;
                padding: 12px 16px;
                display: flex;
                align-items: center;
                font-size: 16px;
                touch-action: manipulation;
                -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
                border: none;
                background: transparent;
                color: white;
                width: 100%;
                text-align: left;
                justify-content: flex-start;
            }
            
            /* Mobile menu button hover states */
            #mobile-menu button:hover,
            #mobile-menu a:hover {
                background-color: rgba(255, 255, 255, 0.1);
            }
            
            /* Mobile hamburger button */
            #mobile-menu-btn {
                touch-action: manipulation;
                -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
            }
        }
        
        .skip-link {
            position: absolute;
            left: -999px;
            top: auto;
            width: 1px;
            height: 1px;
            padding: 0.5rem 1rem;
            overflow: hidden;
            background: #ffffff;
            color: #1e3a8a;
            border-radius: 999px;
            box-shadow: 0 10px 20px rgba(30, 58, 138, 0.2);
            z-index: 2000;
            transition: all 0.3s ease;
        }
        
        .skip-link:focus {
        
        #user-dropdown:not(.hidden) {
            display: block;
        }
        
        /* Mobile-specific improvements */
        @media (max-width: 768px) {
            /* Responsive text sizing for long Norwegian words */
            h1 {
                font-size: 2.5rem !important; /* Reduce from text-6xl to prevent overflow */
                line-height: 1.1 !important;
                word-wrap: break-word;
                hyphens: auto;
                overflow-wrap: break-word;
            }
            
            /* Specific targeting for hero section text */
            h1 .text-gray-800[data-translate="handwritingAnalysis"] {
                font-size: 2.25rem !important; /* Even smaller for the long Norwegian compound word */
                line-height: 1.1 !important;
                word-break: break-word;
                hyphens: auto;
            }
            
            /* Ensure Downloads page headings are also responsive */
            #downloads-hero h1 {
                font-size: 2.5rem !important;
                line-height: 1.1 !important;
                word-wrap: break-word;
                hyphens: auto;
            }
            
            /* Additional text responsiveness for long compound words */
            h2, h3 {
                word-wrap: break-word;
                hyphens: auto;
                overflow-wrap: break-word;
            }
            
            /* Prevent horizontal overflow on mobile */
            body {
                overflow-x: hidden;
            }
            
            /* Ensure containers don't exceed viewport width */
            .max-w-7xl, .max-w-4xl, .max-w-3xl {
                max-width: calc(100vw - 2rem) !important;
                margin-left: auto;
                margin-right: auto;
            }
        }
        
        /* Extra small mobile devices (phones) */
        @media (max-width: 480px) {
            /* Further reduce text size for very small screens */
            h1 {
                font-size: 2rem !important; /* Even smaller on phones */
                line-height: 1.1 !important;
            }
            
            /* Specifically handle the Norwegian compound word */
            h1 .text-gray-800[data-translate="handwritingAnalysis"] {
                font-size: 1.875rem !important; /* 30px equivalent, smaller for Norwegian */
                line-height: 1.1 !important;
            }
            
            /* Downloads page for phones */
            #downloads-hero h1 {
                font-size: 2rem !important;
                line-height: 1.1 !important;
            }
            
            /* Adjust paragraph text for better readability */
            .text-xl {
                font-size: 1.125rem !important; /* Reduce from text-xl */
                line-height: 1.4 !important;
            }
            
            /* Ensure padding doesn't cause overflow */
            .px-4 {
                padding-left: 1rem !important;
                padding-right: 1rem !important;
            }
            
            /* Ensure proper touch targets on mobile */
            .mobile-touch-target {
                min-height: 44px;
                display: flex;
                align-items: center;
            }
            
            /* Improve mobile modal display */
            .fixed.inset-0 {
                padding: 16px;
            }
            
            /* Mobile menu improvements */
            #mobile-menu {
                max-height: calc(100vh - 64px);
                overflow-y: auto;
            }
            
            /* Better spacing for mobile user section */
            #mobile-user-section {
                margin-top: 8px;
                padding-top: 8px;
            }
            
            /* Ensure mobile buttons are properly sized */
            #mobile-menu button {
                min-height: 44px;
                touch-action: manipulation;
            }
            
            /* Fix modal sizing on mobile */
            .modal-body {
                max-height: 70vh;
                overflow-y: auto;
            }
            
            /* Improve touch interaction */
            button, a {
                touch-action: manipulation;
            }
            
            /* Fix header z-index issues on mobile */
            nav {
                z-index: 100;
            }
            
            /* Hide desktop dropdown on mobile - use mobile menu instead */
            /* Note: This rule is now properly scoped to mobile only */
            
            /* Hide desktop dropdown and user menu button on mobile */
            #user-dropdown {
                display: none !important;
            }
            
            #user-menu {
                display: none !important;
            }
            
            /* Ensure mobile menu is accessible */
            #mobile-menu {
                touch-action: manipulation;
            }
            
            /* Make mobile menu items more touchable */
            #mobile-menu button,
            #mobile-menu a {
                min-height: 48px;
                padding: 12px 16px;
                display: flex;
                align-items: center;
                font-size: 16px;
                touch-action: manipulation;
                -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
                border: none;
                background: transparent;
                color: white;
                width: 100%;
                text-align: left;
                justify-content: flex-start;
            }
            
            /* Mobile menu button hover states */
            #mobile-menu button:hover,
            #mobile-menu a:hover {
                background-color: rgba(255, 255, 255, 0.1);
            }
            
            /* Mobile hamburger button */
            #mobile-menu-btn {
                touch-action: manipulation;
                -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
            }
        }
        
        .skip-link {
            position: absolute;
            left: -999px;
            top: auto;
            width: 1px;
            height: 1px;
            padding: 0.5rem 1rem;
            overflow: hidden;
            background: #ffffff;
            color: #1e3a8a;
            border-radius: 999px;
            box-shadow: 0 10px 20px rgba(30, 58, 138, 0.2);
            z-index: 2000;
            transition: all 0.3s ease;
        }
        
        .skip-link:focus {
            left: 1.5rem;
            width: auto;
            height: auto;
            outline: 2px solid #1e3a8a;
        }

/* Modern Typography Defaults */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    letter-spacing: -0.025em;
}
/* Glassmorphic Navigation Bar */
.glass-navbar {
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    background: rgba(255, 255, 255, 0.92) !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    transition: all 0.3s ease;
}
.dark .glass-navbar {
    background: rgba(15, 23, 42, 0.92) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
/* Cosmic Astrological Stellar Background */
.cosmic-bg {
    background: radial-gradient(circle at 50% 20%, rgba(79, 70, 229, 0.18) 0%, rgba(124, 58, 237, 0.08) 35%, rgba(15, 23, 42, 1) 100%) !important;
    color: #f8fafc !important;
    position: relative;
    overflow: hidden;
}

.cosmic-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 0),
                      radial-gradient(rgba(255, 255, 255, 0.08) 2px, transparent 0);
    background-size: 80px 80px, 200px 200px;
    background-position: 0 0, 40px 40px;
    opacity: 0.3;
    pointer-events: none;
}

/* Glow Card - Astrological neon highlights and deep elevations */
.glow-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.glow-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent, rgba(255, 255, 255, 0.03));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.glow-card:hover {
    transform: translateY(-4px);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 12px 40px 0 rgba(139, 92, 246, 0.15), 0 0 20px 2px rgba(99, 102, 241, 0.05);
}

/* Premium Button with glowing hover effects and micro-interactions */
.premium-btn {
    position: relative;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.4);
    overflow: hidden;
}

.premium-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.25),
        transparent
    );
    transition: all 0.6s ease;
}

.premium-btn:hover::before {
    left: 100%;
}

.premium-btn:hover {
    transform: scale(1.03) translateY(-1px);
    box-shadow: 0 6px 20px 0 rgba(124, 58, 237, 0.5);
    filter: brightness(1.1);
}

.premium-btn:active {
    transform: scale(0.98);
}

/* Sub-card glow highlights for download items */
.download-card-premium {
    background: white;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.download-card-premium:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(99, 102, 241, 0.1), 0 10px 10px -5px rgba(99, 102, 241, 0.04);
    border-color: rgba(99, 102, 241, 0.2);
}

/* ==========================================================================
   ✨ PREMIUM VISUAL DESIGN EXTENSIONS (DARK MODE, STARS, RADAR CHART)
   ========================================================================== */

/* Starry Constellation Backdrop */
@keyframes celestial-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.celestial-stars-backdrop {
    animation: celestial-rotate 240s linear infinite;
    opacity: 0.12;
    pointer-events: none;
    transform-origin: center center;
}

/* Personality Radar Chart Styles */
.radar-grid {
    stroke: #e2e8f0;
    stroke-width: 1px;
    stroke-dasharray: 2 2;
}
.radar-axis {
    stroke: #cbd5e1;
    stroke-width: 1.2px;
}
.radar-polygon {
    fill: rgba(99, 102, 241, 0.2);
    stroke: #4f46e5;
    stroke-width: 2.5px;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 4px rgba(99, 102, 241, 0.3));
}
.radar-label {
    font-size: 8px;
    font-weight: 700;
    fill: #475569;
}
.radar-point {
    fill: #4f46e5;
    stroke: #ffffff;
    stroke-width: 1.5px;
    r: 3.5px;
    transition: all 0.3s ease;
}
.radar-point:hover {
    r: 5px;
    fill: #8b5cf6;
}
.dark .radar-grid {
    stroke: #334155;
}
.dark .radar-axis {
    stroke: #475569;
}
.dark .radar-polygon {
    fill: rgba(139, 92, 246, 0.25);
    stroke: #a78bfa;
}
.dark .radar-label {
    fill: #94a3b8;
}
.dark .radar-point {
    fill: #a78bfa;
}

/* System-wide Dark Mode Overrides */
.dark body {
    background-color: #0f172a !important; /* bg-slate-900 */
    color: #f8fafc !important; /* text-slate-50 */
}

.dark .bg-gray-50, .dark .bg-slate-50, .dark .bg-slate-100 {
    background-color: #0f172a !important;
}

.dark .bg-white {
    background-color: #1e293b !important; /* bg-slate-800 */
}

.dark .text-gray-900, .dark .text-slate-900, .dark .text-indigo-950 {
    color: #f8fafc !important;
}

.dark .text-gray-800, .dark .text-slate-800 {
    color: #e2e8f0 !important;
}

.dark .text-gray-700, .dark .text-slate-700 {
    color: #cbd5e1 !important;
}

.dark .text-gray-600, .dark .text-slate-600 {
    color: #94a3b8 !important;
}

.dark .text-gray-500, .dark .text-slate-500 {
    color: #64748b !important;
}

.dark .border, .dark .border-gray-200, .dark .border-slate-100, .dark .border-gray-100 {
    border-color: #334155 !important;
}

.dark .glass-navbar {
    background: rgba(15, 23, 42, 0.92) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dark .glass-card {
    background: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.dark .result-card {
    background: #1e293b !important;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
}

.dark .prose {
    color: #e2e8f0 !important;
}

.dark .prose strong {
    color: #ffffff !important;
}

.dark .analysis-history-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}

.dark .analysis-history-card:hover {
    border-color: #6366f1 !important;
}

.dark input, .dark select, .dark textarea {
    background-color: #0f172a !important;
    color: #ffffff !important;
    border-color: #334155 !important;
}

.dark #user-dropdown {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

.dark #user-dropdown button {
    color: #cbd5e1 !important;
}

.dark #user-dropdown button:hover {
    background-color: #334155 !important;
    color: #ffffff !important;
}

.dark #main-content section.bg-white {
    background-color: #1e293b !important;
}
