/* Dropdown menu styles */
.nav-item.dropdown {
    position: relative;
}

.nav-item.dropdown .dropdown-toggle::after {
    display: none; /* Hide default arrow since we're using mobile-dropdown-arrow */
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 220px;
    padding: 0.5rem 0;
    margin: 0;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.dropdown-menu li {
    list-style: none;
}

.dropdown-menu li a {
    display: block;
    padding: 0.5rem 1rem;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.dropdown-menu li a:hover {
    background-color: #1a3a7a;
    color: white;
}

.dropdown-menu li a.pdf-link {
    color: #d62828;
}

.dropdown-menu li a.pdf-link:hover {
    background-color: #d62828;
    color: white;
}

/* Desktop hover behavior */
@media (min-width: 769px) {
    .nav-item.dropdown:hover .dropdown-menu {
        display: block;
    }
}

/* Mobile dropdown adjustments */
@media (max-width: 768px) {
    .nav-item.dropdown {
        text-align: center;
    }

    .nav-item.dropdown .dropdown-menu {
        position: static;
        display: none;
        width: 100%;
        box-shadow: none;
        padding: 0;
        background-color: #0c2657;
        border-left: none;
        margin: 0.25rem 0;
        text-align: center;
    }
    
    .nav-item.dropdown.show .dropdown-menu {
        display: block;
    }
    
    .nav-item.dropdown .dropdown-toggle {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0.75rem 1rem;
        width: 100%;
        position: relative;
    }

    .dropdown-menu li a {
        padding: 0.75rem 1.5rem;
        color: #ffffff;
        border-left: 3px solid transparent;
        text-align: center;
    }

    /* Mobile dropdown arrow - position it absolutely to not affect centering */
    .mobile-dropdown-arrow {
        position: absolute;
        right: 1rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        transition: transform 0.3s ease;
    }
    
    .mobile-dropdown-arrow i {
        font-size: 1rem;
        color: #ffffff;
    }
    
    .nav-item.dropdown.show .mobile-dropdown-arrow {
        transform: rotate(180deg);
    }
    
    /* PDF link styling for mobile */
    .dropdown-menu li a.pdf-link {
        color: #ff9999;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .dropdown-menu li a.pdf-link:hover,
    .dropdown-menu li a.pdf-link:focus {
        background-color: #d62828;
        color: #ffffff;
    }
    
    .dropdown-menu li a.pdf-link i {
        font-size: 1.1rem;
    }
}

/* In This Section styles for top right positioning */
.magic-sidebar {
    float: right;
    width: 300px;
    margin-left: 20px;
    margin-bottom: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
}

.magic-content {
    overflow: hidden; /* Ensures content wraps around the floated sidebar */
}

@media (max-width: 768px) {
    .magic-sidebar {
        float: none;
        width: 100%;
        margin-left: 0;
        margin-bottom: 1.5rem;
    }
}
