/* --- INCOMET VTC MODERN DESIGN --- */
:root {
    --color-primary: #007BFF;
    --color-secondary: #212529;
    --color-text: #555555;
    --color-background: #FFFFFF;
    --color-light-grey: #f8f9fa;
    --color-white: #ffffff;
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Lato', sans-serif;
    --header-height: 90px;
}

/* --- GLOBAL STYLES --- */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Montserrat:wght@600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    line-height: 1.8;
    color: var(--color-text);
    background-color: var(--color-background);
    /* Increased top padding to clear the larger overlapping logo */
    padding-top: 140px;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- HEADER BASE & SCROLL EFFECT --- */
.site-header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: background-color 0.4s ease, box-shadow 0.4s ease, height 0.4s ease, transform 0.4s ease;
    background-color: var(--color-white);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    height: var(--header-height);
    display: flex;
    align-items: center;
    overflow: visible;
}
.site-header.hide {
    transform: translateY(-100%);
}
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: relative;
}
body.scrolled .site-header {
    height: 75px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

/* --- DESKTOP NAVIGATION --- */
.desktop-nav {
    display: none;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2.5rem;
    flex: 1;
}
.nav-links.nav-links-right {
    justify-content: flex-end;
}
.nav-links a { color: var(--color-secondary); text-decoration: none; font-weight: 700; transition: color 0.4s ease; }
.nav-links a:hover { color: var(--color-primary); }

/* --- OVERLAPPING LOGO STYLES (ELLIPTICAL) --- */
.logo-desktop {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    top: -15px;
}
.logo-desktop .logo-img {
    height: 140px;
    aspect-ratio: 276.859 / 214.853;
    border-radius: 50%;
    object-fit: contain;
    background-color: var(--color-white);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: height 0.4s ease;
}
body.scrolled .logo-desktop .logo-img {
    height: 90px;
}

/* --- DROPDOWN MENU STYLES (FIXED) --- */
.dropdown { position: relative; }

.dropdown-content { 
    /* Changed from display:none to visibility for smoother animation */
    display: block; 
    visibility: hidden;
    position: absolute; 
    background-color: #f9f9f9; 
    min-width: 220px; 
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1); 
    z-index: 1; 
    border-radius: 5px; 
    
    /* The visual gap */
    margin-top: 15px; 
    
    /* Animation settings */
    opacity: 0; 
    transform: translateY(10px); 
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s; 
}

/* THE FIX: Invisible bridge to fill the margin-top gap */
.dropdown-content::before {
    content: "";
    position: absolute;
    top: -20px; /* Covers the 15px margin plus a little extra for safety */
    left: 0;
    width: 100%;
    height: 20px; 
    background: transparent; 
}

.dropdown:hover .dropdown-content { 
    visibility: visible; 
    opacity: 1; 
    transform: translateY(0); 
}

.dropdown-content a { color: var(--color-secondary) !important; padding: 12px 16px; text-decoration: none; display: block; }
.dropdown-content a:hover { background-color: #f1f1f1; }

/* --- MOBILE HEADER & OVERLAY --- */
.bar { display: block; width: 28px; height: 3px; margin: 5px auto; background-color: var(--color-secondary); transition: all 0.4s ease-in-out; }
.nav-overlay { height: 100%; width: 0; position: fixed; z-index: 2000; top: 0; left: 0; background-color: rgba(255, 255, 255, 0.98); backdrop-filter: blur(10px); overflow: hidden; transition: width 0.4s ease-in-out; }
.nav-overlay-content { position: relative; top: 50%; transform: translateY(-50%); width: 100%; text-align: center; }
.close-btn { position: absolute; top: 20px; right: 45px; font-size: 60px; color: var(--color-secondary); text-decoration: none; line-height: 1; }
.nav-links-overlay { list-style: none; padding: 0; }
.nav-links-overlay li a { padding: 10px 20px; text-decoration: none; font-size: 2rem; color: var(--color-secondary); display: block; font-family: var(--font-heading); }
.dropdown-content-overlay { max-height: 0; overflow: hidden; transition: max-height 0.5s ease-in-out; background-color: rgba(0,0,0,0.03); margin: 5px 20px 15px 20px; }
.dropdown-content-overlay.show { max-height: 500px; }
.dropdown-content-overlay a { font-size: 1.5rem !important; font-family: var(--font-body) !important; color: var(--color-text) !important; }

/* --- MEDIA QUERIES for Responsive Layout --- */
@media (min-width: 1024px) {
    .desktop-nav { display: flex; }
    .logo-mobile, .menu-toggle { display: none; }
}

@media (max-width: 1023px) {
    :root { --header-height: 70px; }
    .desktop-nav { display: none; }
    .logo-mobile, .menu-toggle { display: block; }

    /* Add specific body padding for mobile to clear the mobile logo */
    body {
        padding-top: 120px;
    }

    /* --- MOBILE HEADER CHANGES (ELLIPTICAL) --- */
    .logo-mobile {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        top: -35px;
        z-index: 1001;
    }
    .logo-mobile .logo-img {
        height: 120px;
        aspect-ratio: 276.859 / 214.853;
        border-radius: 50%;
        object-fit: contain;
        background-color: var(--color-white);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        transition: none;
    }
    .menu-toggle {
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 999;
        cursor: pointer;
    }
}

/* --- HERO SECTION --- */
.hero {
    position: relative;
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-white);
    overflow: hidden;

    background-image: url('assets/hero.jpg'); /* Ensure this file exists */
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
}

#hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -100;  /* pushes the image behind the text */
}

.hero::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.65); z-index: 1; }
.hero-content { position: relative; z-index: 2; max-width: 800px; padding: 0 20px; }
.hero-content h1 { font-family: var(--font-heading); font-size: 3.5rem; font-weight: 700; margin-bottom: 1rem; }
.hero-content p { font-size: 1.25rem; margin-bottom: 2rem; }

/* --- GENERAL SECTIONS & COMPONENTS --- */
.btn { padding: 1rem 2rem; border-radius: 5px; text-decoration: none; font-weight: bold; transition: all 0.3s ease; border: none; cursor: pointer; font-family: var(--font-heading); }
.btn-primary { background-color: var(--color-primary); color: var(--color-white); }
.btn-primary:hover { background-color: #0056b3; transform: translateY(-3px); }

section { padding: 5rem 0; }
.section-title { text-align: center; font-size: 2.5rem; margin-bottom: 1rem; color: var(--color-secondary); font-family: var(--font-heading); }
.section-subtitle { text-align: center; font-size: 1.2rem; margin-bottom: 4rem; color: var(--color-text); max-width: 700px; margin-left: auto; margin-right: auto; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; }
.card { background: var(--color-white); border: 1px solid #eee; overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.card:hover { transform: translateY(-10px); box-shadow: 0 15px 35px rgba(0,0,0,0.08); }
.card img { width: 100%; height: 220px; object-fit: cover; }
.card-content { padding: 1.5rem; }
.card-content h3 { font-family: var(--font-heading); color: var(--color-secondary); margin-bottom: 0.5rem; }
.read-more { color: var(--color-primary); text-decoration: none; font-weight: bold; display: inline-block; margin-top: 1rem; }

.admissions-banner { background-color: var(--color-secondary); color: var(--color-white); text-align: center; padding: 3rem 1rem; }

/* --- FOOTER STYLES --- */
footer { background: var(--color-secondary); color: rgba(255, 255, 255, 0.8); padding: 4rem 0 0 0; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; padding-bottom: 3rem; border-bottom: 1px solid #444; }
.footer-grid h4 { font-family: var(--font-heading); color: var(--color-white); margin-bottom: 1rem; }
.footer-bottom { text-align: center; padding: 1.5rem 0; font-size: 0.9rem; }

.footer-grid a {
    color: var(--color-white);
    text-decoration: none;
    display: block;
    padding: 0.25rem 0;
    transition: color 0.3s ease;
}

.footer-grid a:hover {
    color: var(--color-primary);
}

/* Unique hero background ONLY for Ufundi Umeme page */
.umeme-page .hero {
    background-image: url('assets/bg-umeme.jpg') !important;
    background-size: cover;
    background-position: center;
	
}

/* Unique hero background for Useremala page */
.useremala-page .hero {
    background-image: url('assets/useremala-hero.jpg') !important;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Optional: dark overlay consistency */
.useremala-page .hero::after {
    background: rgba(0, 0, 0, 0.65);
}
/* Unique hero background for Ushonaji page */
.ushonaji-page .hero {
    background-image: url('assets/ushonaji-hero.jpg') !important;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.ushonaji-page .hero::after {
    background: rgba(0, 0, 0, 0.65);
}
.jiunge-page .hero {
    background-image: url('assets/jiunge-hero.jpg') !important;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.jiunge-page .hero::after {
    background: rgba(0, 0, 0, 0.65);
}
.jiunge-page .hero {
    background-image: url('assets/jiunge-hero.jpg') !important;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.jiunge-page .hero::after {
    background: rgba(0, 0, 0, 0.65);
}

/* Tabs styling */
.form-tabs {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
}

.tab-btn {
    padding: 0.8rem 1.5rem;
    background: #eee;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.tab-btn.active {
    background: var(--color-primary);
    color: #fff;
}

.form-section {
    display: none;
}

.form-section.active {
    display: block;
}


@media (max-width: 768px) { 
    .hero-content h1 { font-size: 2.5rem; } 
    .section-title { font-size: 2rem; } 
}