/* Navbar */
.navbar {
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.8) 0%,
        rgba(255, 255, 255, 0.75) 50%,
        rgba(255, 255, 255, 0.8) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 15px rgba(26, 35, 126, 0.06),
                0 2px 4px rgba(255, 255, 255, 0.15),
                inset 0 0 0 1px rgba(255, 255, 255, 0.25);
    padding: 0.3rem 0;
    border-radius: 0;
    margin-top: 2px;
    margin-bottom: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    border-left: none;
    border-right: none;
    position: relative;
    z-index: 1050;
    height: 52px;
}

.navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(57, 73, 171, 0.05) 0%,
        rgba(255, 214, 0, 0.05) 50%,
        rgba(26, 35, 126, 0.05) 100%);
    pointer-events: none;
}

/* Navbar Brand */
.navbar-brand {
    padding-top: var(--bs-navbar-brand-padding-y);
    padding-bottom: var(--bs-navbar-brand-padding-y);
    margin-right: var(--bs-navbar-brand-margin-end);
    font-size: var(--bs-navbar-brand-font-size);
    color: var(--bs-navbar-brand-color);
    text-decoration: none;
    white-space: nowrap;
    margin-top: -25px;
}

.navbar-brand img {
    max-height: 55px;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(26, 35, 126, 0.1));
    margin-bottom: -25px;
}

.navbar-brand img:hover {
    transform: scale(1.02);
    filter: drop-shadow(0 4px 8px rgba(26, 35, 126, 0.15));
}

.navbar-nav {
    gap: 0.3rem;
}

.nav-link {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.2px;
    padding: 0.3rem 0.5rem !important;
    border-radius: 6px;
    position: relative;
    background: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: #1a237e !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.nav-link::after {
    content: '';
    display: block;
    position: absolute;
    left: 12.5%;
    right: 12.5%;
    bottom: 6px;
    height: 2px;
    background: #ffd600;
    border-radius: 2px;
    opacity: 0;
    transform: scaleX(0);
    transition: all 0.25s cubic-bezier(.4,2,.6,1);
}

.nav-link:hover {
    color: #1a237e !important;
    background: rgba(57, 73, 171, 0.05);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.nav-link.active {
    color: #1a237e !important;
    font-weight: 600;
    text-shadow: none;
    background: rgba(57, 73, 171, 0.08);
}

.nav-link:hover::after, .nav-link.active::after {
    opacity: 1;
    transform: scaleX(1);
}

.nav-link.active::after {
    height: 3px;
    background: #ffd600;
    box-shadow: 0 2px 4px rgba(255, 214, 0, 0.2);
}

/* Dropdown Menu Styles */
.dropdown-menu {
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(26, 35, 126, 0.06),
                0 2px 4px rgba(255, 255, 255, 0.15),
                inset 0 0 0 1px rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 0.4rem 0;
    transform-origin: top;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Show dropdown only on click */
.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Remove hover effects */
.nav-item.dropdown::after,
.dropdown-menu::before {
    display: none;
}

/* Create a safe hover area */
.nav-item.dropdown {
    position: relative;
}

/* Add padding to create a safe hover area */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -30px;
    left: 0;
    width: 100%;
    height: 30px;
    background: transparent;
    z-index: 1051;
}

.dropdown-menu .dropdown-item {
    color: #1a237e;
    font-weight: 500;
    padding: 0.5rem 1.2rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.85rem;
    letter-spacing: 0.2px;
}

.dropdown-menu .dropdown-item::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #ffd600;
    border-radius: 2px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(255, 214, 0, 0.2);
}

.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
    background: rgba(57, 73, 171, 0.05);
    color: #1a237e;
    transform: translateX(4px);
}

.dropdown-menu .dropdown-item:hover::before,
.dropdown-menu .dropdown-item:focus::before {
    width: 75%;
}

.dropdown-menu .dropdown-item.active {
    background: rgba(57, 73, 171, 0.08);
    color: #1a237e;
    font-weight: 600;
}

.dropdown-menu .dropdown-item.active::before {
    width: 75%;
    height: 3px;
}

/* Custom Animated Navbar Toggler */
.navbar-toggler {
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    position: relative;
    background: transparent !important;
    transition: all 0.3s ease;
}

.navbar-toggler:focus {
    box-shadow: none;
    outline: none;
}

.navbar-toggler-icon {
    display: none;
}

.navbar-toggler::before,
.navbar-toggler::after,
.navbar-toggler span {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--primary-blue, #1a237e);
    border-radius: 2px;
    transition: all 0.3s ease;
    left: 0;
}

.navbar-toggler::before {
    top: 6px;
}

.navbar-toggler span {
    top: 14px;
}

.navbar-toggler::after {
    bottom: 6px;
}

/* Animation for open state */
.navbar-toggler[aria-expanded="true"]::before {
    transform: translateY(8px) rotate(45deg);
    background: var(--itcc-yellow, #ffd600);
}

.navbar-toggler[aria-expanded="true"] span {
    opacity: 0;
    transform: translateX(-10px);
}

.navbar-toggler[aria-expanded="true"]::after {
    transform: translateY(-8px) rotate(-45deg);
    background: var(--itcc-yellow, #ffd600);
}

/* Hover effects */
.navbar-toggler:hover::before,
.navbar-toggler:hover::after,
.navbar-toggler:hover span {
    background: var(--itcc-yellow, #ffd600);
}

/* RTL Support */
[dir="rtl"] .navbar-toggler::before,
[dir="rtl"] .navbar-toggler::after,
[dir="rtl"] .navbar-toggler span {
    left: auto;
    right: 0;
}

/* Mobile Navbar Collapse */
@media (max-width: 991px) {
    .navbar-collapse {
        background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.8) 0%,
            rgba(255, 255, 255, 0.75) 50%,
            rgba(255, 255, 255, 0.8) 100%);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        padding: 0.6rem;
        margin-top: 0.5rem;
        box-shadow: 0 6px 20px rgba(26, 35, 126, 0.06),
                    0 2px 4px rgba(255, 255, 255, 0.15),
                    inset 0 0 0 1px rgba(255, 255, 255, 0.25);
    }

    .navbar-collapse::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg,
            rgba(57, 73, 171, 0.05) 0%,
            rgba(255, 214, 0, 0.05) 50%,
            rgba(26, 35, 126, 0.05) 100%);
        pointer-events: none;
    }

    .navbar-nav {
        gap: 0.3rem;
    }

    .nav-link {
        padding: 0.5rem 0.8rem !important;
        border-radius: 12px;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav-link:hover,
    .nav-link.active {
        background: rgba(26, 35, 126, 0.06);
        transform: translateX(4px);
    }

    .dropdown-menu {
        background: transparent;
        box-shadow: none;
        padding: 0;
        margin: 0;
        border-left: 2px solid var(--itcc-yellow);
        margin-left: 1.2rem;
        border-radius: 0;
        animation: none;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .dropdown-menu .dropdown-item {
        padding: 0.5rem 1.2rem;
        font-size: 0.85rem;
    }

    .dropdown-menu .dropdown-item::before {
        display: none;
    }

    .dropdown-menu .dropdown-item:hover,
    .dropdown-menu .dropdown-item:focus {
        transform: translateX(4px);
        background: rgba(26, 35, 126, 0.04);
    }
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Z-index Hierarchy */
.navbar {
    z-index: 1050 !important;
}

.dropdown-menu {
    z-index: 1060 !important;
}

/* Ensure dropdown stays above on mobile */
@media (max-width: 992px) {
    .dropdown-menu {
        z-index: 1060 !important;
    }
    
    .navbar-collapse {
        z-index: 1055 !important;
    }
}

/* RTL Support */
[dir="rtl"] .navbar-nav {
    padding-right: 0;
}

[dir="rtl"] .dropdown-menu {
    text-align: right;
}

[dir="rtl"] .ms-auto {
    margin-left: 0 !important;
    margin-right: auto !important;
}
