/* =========================================
   1. CSS Variables (Theming Foundation)
   ========================================= */
:root {
    /* Colors - Adjust these to match the SCI Logo exactly */
    --primary-color: #0f172a;    /* Deep slate/navy for text */
    --accent-color: #2563eb;     /* Vibrant trust blue for hovers/accents */
    --bg-light: #f8fafc;         /* Off-white background */
    --nav-bg: rgba(255, 255, 255, 0.85); /* Translucent white for glass effect */
    
    /* Typography & Spacing */
    --font-main: 'Inter', sans-serif;
    --transition-speed: 0.3s;
}

/* =========================================
   2. Base Reset & Global Typography
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-light);
    color: var(--primary-color);
    padding-top: 80px; /* Prevents content from hiding behind the fixed navbar */
}

/* Container constraint to keep content centered on large screens */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px; 
}

/* --- THE MAGICAL TYPOGRAPHY TRICK (GLOBAL) --- */
p {
    line-height: 1.85;
    color: #475569;
    font-size: 1.05rem;
}

/* Auto-justify all paragraphs inside main content areas and cards */
main p, .about-content p, .card-body p, .contact-info p, .glass-card p {
    text-align: justify;
}

/* Ensure sections meant to be centered stay perfectly centered */
.text-center p {
    text-align: center !important;
    text-align-last: center; /* Ensures the last line doesn't stretch awkwardly */
}

/* =========================================
   3. Premium Navbar Styling
   ========================================= */
.premium-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: var(--nav-bg);
    
    /* Glassmorphism Effect */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    
    /* Subtle shadow for depth */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    z-index: 1000;
    
    /* Smooth transition for scroll effect */
    transition: background-color 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease, height 0.3s ease;
}

/* State when user scrolls down */
.premium-navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    height: 70px; /* Shrinks slightly on scroll */
}

/* Logo Container */
.logo-container img {
    height: 55px;
    width: auto;
    display: block;
    transition: transform var(--transition-speed) ease;
}

.logo-container img:hover {
    transform: scale(1.03); 
}

/* Mobile Menu Button (Hidden on Desktop) */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-color);
}

/* =========================================
   4. Desktop Navigation Links
   ========================================= */
.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    text-decoration: none;
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: color var(--transition-speed) ease;
}

.nav-links a:hover,
.nav-links a.active-link {
    color: var(--accent-color);
}

/* Animated Underline Effect */
.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -6px;
    left: 0;
    background-color: var(--accent-color);
    transition: width var(--transition-speed) ease-in-out;
    border-radius: 2px;
}

.nav-links a:hover::after,
.nav-links a.active-link::after {
    width: 100%;
}

/* =========================================
   5. Mobile Responsiveness & Animated Menu
   ========================================= */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block; /* Show hamburger menu */
    }

    .nav-links {
        position: absolute;
        top: 100%; /* Drops down right below the navbar */
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        
        /* Smooth Slide-Down Magic */
        max-height: 0;
        overflow: hidden;
        padding: 0;
        transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out;
    }

    .nav-links.active {
        max-height: 400px; /* Expands smoothly */
        padding: 2rem 0;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
        margin-bottom: 1.5rem;
    }

    .nav-links a::after {
        display: none; /* Hide underline effect on mobile */
    }
}

/* =========================================
   6. General UI Components
   ========================================= */
/* Smooth hover lift for cards */
.project-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1) !important;
}

/* =========================================
   7. Animation Utilities (Intersection Observer)
   ========================================= */
.fade-in-up, .glass-card, .project-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in-up.is-visible, 
.glass-card.is-visible, 
.project-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered Animation Delays */
.delay-1 { transition-delay: 0.15s; }
.delay-2 { transition-delay: 0.3s; }
.delay-3 { transition-delay: 0.45s; }

/* =========================================
   8. Premium Form Styling (Restored)
   ========================================= */
.premium-form .form-group {
    margin-bottom: 1.5rem;
}

.premium-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
}

.premium-form input,
.premium-form textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    font-family: var(--font-main);
    color: var(--primary-color);
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    transition: all var(--transition-speed) ease;
}

/* Beautiful Focus States for Developers */
.premium-form input:focus,
.premium-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1); /* Soft glow ring */
}

/* Button Hover State */
.premium-form button:hover {
    background: #1d4ed8 !important; /* Slightly darker blue */
    transform: translateY(-2px);
}
/* =========================================
   9. Quick Fixes & Overrides
   ========================================= */

/* Fix 1: Keep text white on dark background sections */
.page-header p, 
.hero-section p, 
.foundation-cta p {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Fix 2: Bulletproof Mobile Menu Dropdown */
@media (max-width: 768px) {
    .nav-links {
        z-index: 9999 !important; /* Forces the menu to drop in front of everything */
        border-top: 1px solid #e2e8f0;
    }
    .nav-links.active {
        max-height: 500px !important; /* Forces the menu open */
        padding: 2rem 0 !important;
        border-bottom: 4px solid var(--accent-color);
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    }
}