:root {
    --primary-color: #003366; /* Navy Blue - Education */
    --secondary-color: #FFC107; /* Gold/Yellow - Brightness */
    --accent-color: #e74c3c;
    --text-dark: #333333;
    --text-light: #f8f9fa;
    
    /* Fluid Typography - Scales smoothly between viewport widths */
    --fs-display-1: clamp(2.5rem, 5vw + 1rem, 5rem);
    --fs-display-2: clamp(2rem, 4vw + 1rem, 4rem);
    --fs-display-3: clamp(1.75rem, 3vw + 1rem, 3.5rem);
    --fs-display-4: clamp(1.5rem, 2.5vw + 1rem, 3rem);
    --fs-h1: clamp(2rem, 4vw + 1rem, 3.5rem);
    --fs-h2: clamp(1.75rem, 3vw + 1rem, 2.5rem);
    --fs-h3: clamp(1.5rem, 2vw + 1rem, 2rem);
    --fs-body: clamp(0.9rem, 1vw + 0.5rem, 1.1rem);
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-size: var(--fs-body);
    line-height: 1.6;
}

h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

/* Apply Fluid Sizes */
.display-1 { font-size: var(--fs-display-1); }
.display-2 { font-size: var(--fs-display-2); }
.display-3 { font-size: var(--fs-display-3); }
.display-4 { font-size: var(--fs-display-4); }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

img {
    max-width: 100%;
    height: auto;
    display: block; /* Removes bottom space */
}

/* Gradient Backgrounds */
.gradient-bg-1 {
    background: linear-gradient(135deg, var(--primary-color) 0%, #001f3f 100%);
}
.gradient-bg-2 {
    background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
}
.gradient-bg-3 {
    background: linear-gradient(135deg, #8e44ad 0%, #2c3e50 100%);
}

.gradient-overlay-primary {
    background: linear-gradient(135deg, rgba(0, 51, 102, 0.95), rgba(0, 31, 63, 0.9));
}
.gradient-overlay-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.8), rgba(255, 152, 0, 0.9));
}
.gradient-overlay-success {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.9), rgba(39, 174, 96, 0.9));
}

.icon-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: var(--primary-color);
    font-size: 5rem;
}

/* Navbar */
.navbar {
    padding-top: 1rem;
    padding-bottom: 1rem;
    transition: all 0.3s ease;
}

.navbar-brand .school-logo {
    color: var(--secondary-color);
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-link {
    color: var(--primary-color) !important;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--secondary-color) !important;
}

/* Mega Menu Desktop */
@media (min-width: 992px) {
    .dropdown:hover .dropdown-menu {
        display: block;
        margin-top: 0;
        animation: fadeIn 0.3s ease;
    }
    
    .mega-menu {
        border-top: 3px solid var(--secondary-color);
        background-color: #fff;
        margin-top: 0;
        left: 0;
        right: 0;
        width: 100%;
        padding: 2rem;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    }
}

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

.hover-link {
    position: relative;
    padding-left: 0;
    transition: padding-left 0.3s ease;
    text-decoration: none;
    color: var(--text-dark);
    display: block;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.hover-link:hover {
    padding-left: 8px;
    color: var(--primary-color) !important;
    text-decoration: none;
}

/* Hero Section */
.hero-section {
    position: relative;
    overflow: hidden;
}

.carousel-item {
    position: relative;
    height: 85vh; /* Default desktop height */
    min-height: 600px;
    background-size: cover;
    background-position: center;
}
.carousel-item::before {
    content: "";
    position: absolute;
    top: 0; bottom: 0; left: 0; right: 0;
    background: linear-gradient(rgba(0, 51, 102, 0.5), rgba(0, 51, 102, 0.8)); /* Improved overlay */
    z-index: 1;
}

.gradient-bg-1, .gradient-bg-2, .gradient-bg-3 {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0;
}
.pattern-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: radial-gradient(rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: 0;
    opacity: 0.3;
}
.carousel-icon {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 15vw;
    color: rgba(255,255,255,0.1);
    z-index: 0;
}

/* Carousel Caption Styling */
.carousel-caption {
    z-index: 2;
    text-align: left; /* Default for desktop */
    left: 0;
    right: 0;
    width: 100%;
    top: 50%;
    transform: translateY(-50%);
    bottom: auto;
    padding-bottom: 0;
}

/* Feature/Advantage Cards */
.feature-card, .advantage-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    border: none;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}
.feature-card:hover, .advantage-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 1rem 3rem rgba(0,0,0,.15) !important;
}

/* Buttons */
.btn {
    padding: 0.8rem 2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 50px; /* Pill shape */
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.btn-primary:hover {
    background-color: #002244;
    border-color: #002244;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,51,102,0.3);
}
.btn-warning {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #000;
}
.btn-warning:hover {
    background-color: #ffca2c;
    border-color: #ffc720;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,193,7,0.3);
}

/* Pulse Animation */
.pulse-btn {
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(255, 193, 7, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0); }
}

/* Footer & Socials */
footer {
    background-color: #1a1a1a;
    color: #b0b0b0;
}
footer h5 {
    color: #fff;
}
footer a {
    color: #b0b0b0;
    transition: color 0.3s ease;
}
footer a:hover {
    color: var(--secondary-color) !important;
    text-decoration: none !important;
    padding-left: 5px; /* Slight nudge on verify */
}

/* Utilities */
.ls-2 { letter-spacing: 2px; }
.section-padding { padding: clamp(3rem, 5vw, 6rem) 0; }
.bg-gradient-primary { background: linear-gradient(135deg, var(--primary-color) 0%, #001f3f 100%); }
.divider { width: 60px; height: 4px; border-radius: 2px; margin-top: 1rem; background-color: var(--secondary-color); }
.object-fit-cover { object-fit: cover; }
.overlay-gradient {
    background: linear-gradient(to right, rgba(0, 51, 102, 0.9), rgba(0, 51, 102, 0.4));
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%; z-index: 1;
}

/* Slide Up Animation */
@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.slide-up-anim {
    animation: slideUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0; 
}
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

/* SVG Shape */
.shape-bottom {
    position: absolute;
    bottom: -1px; left: 0; width: 100%;
    overflow: hidden; line-height: 0; z-index: 2;
}
.shape-bottom svg {
    position: relative; display: block;
    width: calc(100% + 1.3px); height: clamp(40px, 8vw, 100px);
}

/* Streams Grid */
.stream-box {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 2rem;
    border-radius: 15px;
    height: 100%;
    transition: all 0.4s ease;
}
.stream-box:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}
.stream-box:hover .stream-icon { transform: scale(1.1) rotate(5deg); transition: transform 0.3s; }

/* News Ticker */
.news-ticker-wrap {
    background: var(--primary-color);
    color: #fff;
    overflow: hidden;
    height: 40px;
    line-height: 40px;
    font-size: 0.9rem;
}
.ticker-title {
    background: var(--secondary-color);
    color: #000;
    padding: 0 15px;
    font-weight: 700;
    height: 100%;
    display: flex;
    align-items: center;
    float: left;
    position: relative;
    z-index: 10;
    font-size: 0.8rem;
    text-transform: uppercase;
}
.ticker-content {
    display: inline-block;
    white-space: nowrap;
    animation: ticker 25s linear infinite;
    padding-left: 100%;
}
@keyframes ticker {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

/* =========================================
   MOBILE RESPONSIVE OPTIMIZATION
   ========================================= */
@media (max-width: 991px) {
    /* Navbar Mobile Styles */
    .navbar-collapse {
        background: #fff;
        padding: 1rem;
        border-radius: 10px;
        box-shadow: 0 5px 20px rgba(0,0,0,0.1);
        max-height: 70vh;
        overflow-y: auto;
        margin-top: 10px;
    }
    
    .nav-item {
        border-bottom: 1px solid #f0f0f0;
    }
    .nav-item:last-child { border-bottom: none; }
    
    .nav-link {
        padding: 12px 0 !important;
        font-size: 1.1rem; /* Easier to tap */
        color: #003366 !important;
    }

    /* Mega Menu on Mobile */
    .mega-menu {
        position: static !important;
        margin-top: 0 !important;
        padding: 0 1rem !important;
        box-shadow: none !important;
        border: none !important;
        background: #f8f9fa; /* Slight grey background */
        width: 100% !important;
        border-radius: 5px;
    }
    
    .dropdown-menu.show {
        display: block;
        animation: slideDown 0.3s ease;
    }
    
    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }
    
    .mega-menu .col-lg-3 {
        margin-bottom: 0;
        padding: 1rem 0;
        border-bottom: 1px solid #eee;
    }
    
    .mega-menu h6 {
        margin-top: 0.5rem;
        color: var(--primary-color);
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.9rem;
    }

    /* Hero Section Mobile */
    .carousel-item {
        height: auto !important; /* Let content dictate height */
        min-height: 100vh; /* Full viewport height for impact */
        padding-top: 80px; /* Account for fixed navbar if any */
        padding-bottom: 4rem;
    }
    
    .carousel-caption {
        position: relative; /* Release from absolute */
        top: auto;
        transform: none;
        left: 0; right: 0;
        padding: 2rem 1.5rem;
        text-align: center; /* Center text on mobile */
        background: rgba(0,0,0,0.4); /* Slight darkness for readability */
        backdrop-filter: blur(2px);
        margin-top: 2rem;
        border-radius: 10px;
    }
    
    .carousel-caption h2, 
    .display-1, .display-2, .display-3 {
        font-size: 2rem !important; /* Force readable size */
        margin-bottom: 1rem;
    }
    
    .carousel-caption p.lead {
        font-size: 1rem !important;
        margin-bottom: 1.5rem !important;
        display: block !important; /* Force show briefly or hide properly */
    }

    /* Buttons in Hero Mobile */
    .carousel-caption .btn {
        display: inline-block;
        width: auto;
        margin: 5px;
        font-size: 0.85rem;
        padding: 0.6rem 1.2rem;
        min-width: 130px;
    }
    
    /* Fix Section Sizing for Mobile */
    .section-padding { padding: 3rem 0 !important; }

    /* Fix General Buttons on Mobile */
    .btn {
        padding: 0.6rem 1.4rem;
        font-size: 0.9rem;
        white-space: normal; /* Allow text wrapping if needed */
        line-height: normal;
        height: auto;
    }
    
    /* Override Bootstrap large button padding on mobile */
    .btn-lg, .px-5, .py-3 {
        padding: 0.7rem 1.5rem !important;
        font-size: 0.95rem !important;
    }

    /* Shape Divider size */
    .shape-bottom svg { height: 30px; }
    
    /* Stats */
    .divide-cols > [class*="col-"] {
        border-right: none !important;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        padding-bottom: 1.5rem;
        margin-bottom: 1.5rem;
    }
    .divide-cols > [class*="col-"]:last-child {
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
    }
    
    /* Ensure no horizontal overflow */
    .container, .container-fluid {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    /* Adjust grid gaps */
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    .col, [class*="col-"] {
        padding-left: 10px;
        padding-right: 10px;
    }
}
