/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 18px; /* larger base */
    scroll-behavior: smooth;
}

:root {
    /* Celestial theme palette */
    --celestial-bg: #0b0f1a;           /* deep night */
    --celestial-bg-2: #1a1f2b;         /* horizon fade */
    --celestial-star: rgba(255, 255, 255, 0.9);
    --celestial-mist: rgba(255, 255, 255, 0.08);
    --celestial-accent: #cbd5e1;       /* cool gray for text */
    --celestial-primary: #e2e8f0;      /* light text */
    --celestial-muted: rgba(226, 232, 240, 0.75);
    --celestial-line: rgba(255, 255, 255, 0.25);
}

body {
    font-family: 'EB Garamond', Georgia, 'Times New Roman', Times, serif;
    line-height: 1.7;
    color: #333;
    background-color: #f8f9fa;
    overflow-x: hidden;
    font-weight: 500; /* slightly thicker default */
}

/* Optional serif display for celestial headings */
.font-display {
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    letter-spacing: 0.02em;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #2c3e50;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.375rem; }

p {
    margin-bottom: 1rem;
    color: #555;
}

/* Navigation */
.nav {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

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

.nav-logo {
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #1f2937; /* slate-800 */
    margin: 0;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: #1f2937; /* slate-800 */
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.15rem;
    font-family: inherit;
}

.nav-link:hover {
    color: #0f172a; /* darker */
    background-color: #f3f4f6; /* subtle slate-100 */
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.nav-link:focus-visible {
    background-color: #f3f4f6;
    color: #0f172a;
    box-shadow: 0 0 0 2px rgba(52,152,219,0.25);
    outline: none;
}

/* Main Content */
.main {
    margin-top: 80px; /* Account for fixed nav */
    min-height: calc(100vh - 80px);
}

.section {
    padding: 4rem 0;
}

/* Hero Section */
.section-home {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 6rem 0;
}

/* Remove celestial variant (reverting to light theme) */
.section-home.celestial::before,
.section-home.celestial::after { display: none; }

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: white;
}

.celestial .hero-title { color: inherit; }

.hero-subtitle {
    font-size: 1.35rem;
    margin-bottom: 2rem;
    color: rgba(255,255,255,0.9);
}

.celestial .hero-subtitle { color: inherit; }

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Celestial hero inner elements */
.celestial-hero { max-width: 720px; margin: 0 auto; }

.celestial-moon { display: none; }

.celestial-divider { display: none; }

/* Sections */
.section-about {
    background: white;
    text-align: center;
}

.section-auth {
    background: #f8f9fa;
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.section-dashboard {
    background: white;
    min-height: 70vh;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: auto;
}

.footer p {
    margin: 0;
    color: rgba(255,255,255,0.8);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alert System */
.alert-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 1500;
    max-width: 400px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .main {
        margin-top: 120px; /* Account for taller mobile nav */
    }
}

@media (max-width: 480px) {
    .hero-title { font-size: 2.25rem; }
    
    .hero-subtitle { font-size: 1.25rem; }
    
    .nav-container {
        padding: 0.5rem 15px;
    }
    
    .section {
        padding: 3rem 0;
    }
    
    .section-home {
        padding: 4rem 0;
    }
}
