/* --- Top Bar & Fixed Notification --- */
.top-bar {
    background-color: #333 !important;
    color: white !important;
    height: 45px !important;
    min-height: 45px !important;
    display: flex !important;
    align-items: center !important;
    position: relative !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 9999 !important;
    overflow: hidden;
}

.notif-label {
    background-color: #dc3545 !important;
    color: white !important;
    padding: 0 25px !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    font-weight: bold !important;
    position: absolute !important;
    left: 10% !important;
    z-index: 10000 !important;
    clip-path: polygon(0 0, 90% 0, 100% 100%, 0% 100%);
}

.marquee-container {
    width: 100% !important;
    padding-left: 160px !important;
}

/* --- Responsive Fix for Mobile --- */
@media (max-width: 768px) {
    .notif-label {
        font-size: 12px !important;
        padding: 0 15px !important;
    }
    .marquee-container {
        padding-left: 130px !important;
    }
    .school-name {
        font-size: 1rem;
    }
}

/* --- Navbar Branding --- */
.school-name {
    color: #003366;
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1.1;
    margin-bottom: 0;
}

.tag-line {
    color: #dc3545;
    font-style: italic;
    font-size: 0.8rem;
    display: block;
}

/* --- Hover Dropdown Logic --- */
@media (min-width: 992px) {
    .navbar-nav .dropdown-menu {
        display: block !important;
        visibility: hidden;
        opacity: 0;
        width: 250px;
        transform: translateY(20px) !important;
        transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.3s ease !important;
        border-radius: 0 0 4px 4px;
        pointer-events: none;
    }
    .nav-item.dropdown:hover>.dropdown-menu {
        visibility: visible !important;
        opacity: 1 !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
        transform: translateY(0) !important;
        pointer-events: auto !important;
        border: none !important;
    }
}

.navbar-nav a {
    font-weight: 700 !important;
    padding: 8px 10px !important;
}

.dropdown-item {
    padding: 10px 20px;
    border-bottom: 1px solid #f8f9fa;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-menu.show {
    border: none;
}
.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #dc3545;
}

/* --- Sticky Navbar Slide Down Animation --- */
/* --- Navbar Base --- */
.navbar {
    width: 100%;
    position: relative; 
    z-index: 1020;
    transition: background-color 0.3s ease;
}

/* --- Sticky Navbar (Activated when hero touches top) --- */
.navbar-sticky {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1030;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    /* This animation triggers when the hero section 'touches' the top body */
    animation: navSlideDown 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes navSlideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}



/* --- NEW FEATURE: Animated Hamburger Button --- */
.navbar-toggler {
    border: none !important;
    padding: 0 !important;
}

.navbar-toggler:focus {
    box-shadow: none !important;
}

.hamburger-icon {
    width: 30px;
    height: 22px;
    position: relative;
    cursor: pointer;
}

.hamburger-icon span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: #003366;
    border-radius: 9px;
    transition: .3s ease-in-out;
}

.hamburger-icon span:nth-child(1) { top: 0px; }
.hamburger-icon span:nth-child(2) { top: 10px; }
.hamburger-icon span:nth-child(3) { top: 20px; }

.navbar-toggler:not(.collapsed) .hamburger-icon span:nth-child(1) {
    top: 10px;
    transform: rotate(135deg);
}

.navbar-toggler:not(.collapsed) .hamburger-icon span:nth-child(2) {
    opacity: 0;
    /* left: -40px; */
}

.navbar-toggler:not(.collapsed) .hamburger-icon span:nth-child(3) {
    top: 10px;
    transform: rotate(-135deg);
}

/* --- UPDATED: Smooth Left-to-Right Mobile Slide --- */

@media (min-width: 992px) {
    /* Position the second-level menu to the right of the first menu */
    .dropdown-submenu {
        position: relative;
    }

    .dropdown-submenu > .dropdown-menu {
        top: 0;
        left: 100%; /* Push to the right */
        margin-top: -1px;
        margin-left: 0;
        visibility: hidden;
        opacity: 0;
        transform: translateX(10px) !important; /* Slide-in effect */
        transition: all 0.3s ease;
        position: absolute;
        min-width: 220px;
        z-index: 1001;
        background: white;
        border: 1px solid #e0e0e0;
        border-radius: 4px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15) !important;
    }

    /* Show submenu on hover or click (via JavaScript) */
    .dropdown-submenu:hover > .dropdown-menu {
        visibility: visible !important;
        opacity: 1 !important;
        transform: translateX(0) !important;
        pointer-events: auto !important;
    }
    
    .dropdown-submenu > .dropdown-menu[style*="visibility: visible"] {
        visibility: visible !important;
        opacity: 1 !important;
        transform: translateX(0) !important;
        pointer-events: auto !important;
    }
    
    /* Arrow indicator for Message button */
    .dropdown-submenu > .dropdown-toggle::after {
        content: '';
        border: solid #333;
        border-width: 0 2px 2px 0;
        display: inline-block;
        padding: 3px;
        transform: rotate(-45deg);
        margin-left: 8px;
    }
}

@media (max-width: 991px) {
    /* 1. Target the menu AND the transition state together */
    .navbar-collapse, 
    .navbar-collapse.collapsing {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important; /* Start off-screen */
        width: 280px !important;
        height: 100vh !important;
        background: #fff !important;
        display: block !important;
        z-index: 1050 !important;
        /* FORCE the transition to happen on LEFT, with 0s delay */
        transition: left 0.3s ease-in-out !important; 
        margin: 0 !important;
    }

    /* 2. Remove the vertical sliding height animation entirely */
    .navbar-collapse.collapsing {
        height: 100vh !important;
        transition: left 0.3s ease-in-out !important;
    }

    /* 3. When open, move to left 0 */
    .navbar-collapse.show {
        left: 0 !important;
        /* Ensure it stays open and doesn't snap shut */
        transition: left 0.3s ease-in-out !important;
    }

    /* Fix nav items for sidebar layout */
    .navbar-nav {
        flex-direction: column !important;
        padding-top: 60px !important;
    }

    .dropdown-submenu > .dropdown-menu {
        position: relative !important;
        left: 0 !important;
        margin-left: 15px !important; /* Indent on mobile sidebar */
        box-shadow: none !important;
        display: none; /* Hidden until clicked on mobile */
    }
    
    .dropdown-submenu.show > .dropdown-menu {
        display: block;
    }
}

/* --- Responsive Fix for Mobile --- */
@media (max-width: 768px) {
    .notif-label {
        font-size: 12px !important;
        padding: 0 15px !important;
    }
    .marquee-container {
        padding-left: 130px !important;
    }
    .school-name {
        font-size: 0.9rem !important; /* Slightly smaller for tablets */
    }
}

/* Specific fix for screens 425px and below */
@media (max-width: 425px) {
    .navbar > .container {
        /* This ensures the brand and hamburger stay on the same line */
        display: flex !important;
        flex-wrap: nowrap !important; 
        align-items: center !important;
        justify-content: space-between !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .navbar-brand {
        /* Prevents the logo from taking up 100% width and pushing the button down */
        max-width: 80% !important; 
        margin-right: 0 !important;
    }

    .school-name {
        font-size: 0.75rem !important; /* Shrinks the text to fit */
        white-space: normal !important; /* Allows text to wrap if needed */
        line-height: 1.2 !important;
    }

    .tag-line {
        font-size: 0.65rem !important;
    }

    .hamburger-icon {
        /* Slightly smaller icon for small phones */
        width: 25px;
        height: 18px;
    }
}

.admin-login-link {
    color: #001f3f; /* School Navy */
    font-weight: 600;
    text-decoration: none;
    transition: 0.3s;
}

.admin-login-link:hover {
    color: #f37021; /* School Orange */
}

.admin-login-link i {
    font-size: 1.2rem;
    vertical-align: middle;
}