/* ===============================
   NCERT Department Navigation
================================ */

#navigation {
    width: 100%;
    min-height: 70px;
    padding: 0;
    background: #ffffff !important;
    border-top: 3px solid #851b40;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

#navigation > .container {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    max-width: 1440px;
    min-height: 67px;
    margin: 0 auto;
}

/* NCERT Home Button */
#navigation .ncert-home-link {
    display: inline-block;
    flex: 0 0 auto;
    padding: 9px 12px;
    margin: 0;
    color: #ffffff !important;
    background: #851b40 !important;
    border: 1px solid #851b40;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
}

#navigation .ncert-home-link:hover,
#navigation .ncert-home-link:focus {
    color: #ffffff !important;
    background: #68132f !important;
    border-color: #68132f;
    text-decoration: none;
}

/* Department Title */
.ncert-department-title {
    flex: 0 1 310px;
    min-width: 190px;
    padding: 4px 0 4px 13px;
    border-left: 2px solid #851b40;
    line-height: 1.4;
}

.ncert-department-title .department-hi {
    color: #851b40;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
}

.ncert-department-title .department-en {
    margin-top: 3px;
    color: #555555;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
}

/* Mobile Toggle Button */
#navigation .navbar-toggler {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 6px 9px;
    border: 1px solid #d8c4cc;
    border-radius: 4px;
}

/* Navigation Menu */
#navigation .navbar-collapse {
    flex: 1 1 auto;
    min-width: 0;
}

#navigation .navbar-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    margin-left: auto;
}

#navigation .nav-item {
    flex: 0 0 auto;
}

#navigation .nav-link {
    display: block;
    padding: 9px 7px;
    color: #333333;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
    border-radius: 4px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

#navigation .nav-link:hover,
#navigation .nav-link:focus {
    color: #851b40;
    background: #f8eef2;
    text-decoration: none;
}

#navigation .nav-link:focus-visible {
    outline: 2px solid #851b40;
    outline-offset: 2px;
}

/* Dropdown Menu */
#navigation .dropdown-menu {
    min-width: 190px;
    margin-top: 5px;
    padding: 5px;
    background: #ffffff;
    border: 1px solid #e3d7dc;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

#navigation .dropdown-item {
    padding: 8px 12px;
    color: #333333;
    font-size: 13px;
    white-space: normal;
    border-radius: 3px;
}

#navigation .dropdown-item:hover,
#navigation .dropdown-item:focus {
    color: #851b40;
    background: #f8eef2;
}

/* Medium Screens */
@media (max-width: 1199px) {
    #navigation > .container {
        gap: 9px;
    }

    .ncert-department-title {
        flex-basis: 250px;
        min-width: 170px;
        padding-left: 10px;
    }

    .ncert-department-title .department-hi {
        font-size: 12px;
    }

    .ncert-department-title .department-en {
        font-size: 10px;
    }

    #navigation .nav-link {
        padding-right: 5px;
        padding-left: 5px;
        font-size: 12px;
    }
}

/* Tablets and Mobile */
@media (max-width: 991px) {
    #navigation > .container {
        flex-wrap: wrap;
        gap: 10px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    #navigation .ncert-home-link {
        font-size: 12px;
    }

    .ncert-department-title {
        flex: 1 1 200px;
        min-width: 0;
    }

    .ncert-department-title .department-hi {
        font-size: 14px;
    }

    .ncert-department-title .department-en {
        font-size: 11px;
    }

    #navigation .navbar-toggler {
        margin-left: auto;
    }

    #navigation .navbar-collapse {
        flex: 0 0 100%;
        width: 100%;
    }

    #navigation .navbar-nav {
        align-items: stretch;
        margin: 8px 0 0;
    }

    #navigation .nav-item {
        width: 100%;
    }

    #navigation .nav-link {
        padding: 9px 10px;
        font-size: 14px;
        white-space: normal;
    }

    #navigation .dropdown-menu {
        margin: 0 0 5px 10px;
        box-shadow: none;
    }
}

/* Small Mobile Screens */
@media (max-width: 480px) {
    #navigation > .container {
        gap: 8px;
    }

    #navigation .ncert-home-link {
        padding: 8px 9px;
        font-size: 11px;
    }

    .ncert-department-title {
        flex-basis: 100%;
        order: 3;
        margin-top: 4px;
    }

    #navigation .navbar-toggler {
        order: 2;
    }

    #navigation .navbar-collapse {
        order: 4;
    }
}