/* =====================================================
   LAYOUT.CSS - Padmashri Manibhai Desai College
   Clean Final Responsive Version
   ===================================================== */

/* =========================
   ROOT VARIABLES
========================= */

:root {
    --college-red: #991b1b;
    --college-orange: #ea580c;
    --college-navy: #1f2f53;
    --college-gold: #fbbf24;

    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --text-dark: #333333;
    --text-white: #ffffff;

    --z-header: 1000;
    --z-dropdown: 1001;
    --z-sub-dropdown: 1002;
}

/* =========================
   GLOBAL RESET
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-light);
}

main {
    margin-top: 155px; /* Desktop header height */
    min-height: 80vh;
}

/* =========================
   HEADER
========================= */

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-white);
    z-index: var(--z-header);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

/* ===== Header Top ===== */

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 5%;
    /* height: 95px; */
    min-height: 95px;
    position: relative;
}

.header-logo img {
    height: 70px;
}

.header-text {
    text-align: center;
    flex-grow: 1;
}

/* Small Top Text */
.logonm2 {
    font-size: 1rem;
    color: #475569;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Main College Name */
.logonm {
    font-family: 'Noto Serif', serif;
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;

    background: linear-gradient(to right, #991b1b, #ea580c, #991b1b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* =========================
   NAVIGATION BAR
========================= */

.bar {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--college-navy);
    border-top: 4px solid var(--college-orange);
}

/* Nav Links */
nav > a,
.dropbtn {
    text-decoration: none;
    color: var(--text-white);
    font-weight: 500;
    font-size: 1rem;
    padding: 15px 20px;
    display: block;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
}

nav > a:hover,
.dropdown:hover .dropbtn,
nav > a.active {
    background-color: var(--college-orange);
}

/* =========================
   DROPDOWN (DESKTOP)
========================= */

.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-white);
    min-width: 240px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border-top: 3px solid var(--college-orange);
    z-index: var(--z-dropdown);
}

.dropdown:hover .dropdown-content {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

.dropdown-content a {
    color: var(--text-dark);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.95rem;
    border-bottom: 1px solid #f1f1f1;
    transition: 0.2s;
}

.dropdown-content a:hover {
    background-color: #fff7ed;
    color: var(--college-red);
    padding-left: 20px;
}

/* =========================
   SUB DROPDOWN (DESKTOP)
========================= */

.sub-dropdown {
    position: relative;
}

.sub-dropbtn {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    font-size: 0.95rem;
    padding: 12px 16px;
    color: var(--text-dark);
    cursor: pointer;
}

.sub-dropdown-content {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 220px;
    background-color: var(--bg-white);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border-left: 3px solid var(--college-orange);
    z-index: var(--z-sub-dropdown);
}

.sub-dropdown:hover .sub-dropdown-content {
    display: block;
}

/* =========================
   MOBILE TOGGLE BUTTON
========================= */
/* =====================================================
   RESPONSIVE.CSS - Mobile & Tablet Styles
   ===================================================== */

@media screen and (max-width: 992px) {






    /* --- 1. Adjust Main Content Spacing --- */
    main {
        margin-top: 100px !important; /* Smaller header on mobile */
    }

    /* --- 2. Shrink Header Text & Logo --- */
    .header-top {
        min-height: 70px !important;
        padding: 5px 3%;
    }

    .header-logo img {
        height: 50px !important; /* Forces logo to be smaller */
        width: auto;
    }

    .logonm2 {
        font-size: 0.7rem !important;
        letter-spacing: 0.5px;
    }

    .logonm {
        font-size: 1rem !important; /* Prevents text overlap */
        display: block;
    }

    /* --- 3. Mobile Menu Button Style --- */
    .mobile-menu-toggle {
        display: block !important;
        background: none;
        border: 1.5px solid var(--college-red);
        color: var(--college-red);
        padding: 5px 10px;
        border-radius: 4px;
        font-size: 1.2rem;
        cursor: pointer;
    }

    /* --- 4. Navigation Bar Transformation --- */
    .bar {
        display: none; /* Hidden by default */
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--college-navy);
        max-height: 80vh;
        overflow-y: auto;
        border-top: 2px solid var(--college-orange);
        align-items: flex-start; /* Align text to left */
    }

    /* Shown when JS adds the .active class */
    .bar.active {
        display: flex !important;
    }

    nav > a, .dropbtn {
        width: 100%;
        padding: 15px 5%;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        text-align: left;
    }

    /* --- 5. Mobile Dropdowns --- */
    .dropdown {
        width: 100%;
    }

    .dropdown-content, 
    .sub-dropdown-content {
        position: static !important; /* Stacks items vertically */
        display: none; /* Hidden until .active added by JS */
        width: 100%;
        background-color: rgba(0, 0, 0, 0.2) !important;
        box-shadow: none !important;
        border: none !important;
    }

    /* Shows content when JS toggles .active on the parent div */
    .dropdown.active > .dropdown-content,
    .sub-dropdown.active > .sub-dropdown-content {
        display: block !important;
    }

    .dropdown-content a {
        padding-left: 10% !important;
        color: white !important;
    }

    .sub-dropdown-content a {
        padding-left: 15% !important;
        background-color: rgba(255,255,255,0.05);
    }

    /* Change arrow direction in mobile when active */
    .dropdown.active > .dropbtn::after {
        content: " ▴";
    }
}