/******************
* Accessibility Toolbar Style
******************/
.a11y-toolbar ul li button {
    background: var(--muted);
    opacity: 0.85;
}

.a11y-toolbar.reversed button:hover .offscreen, .a11y-toolbar.reversed button:focus .offscreen {
    font-family: 'Outfit', sans-serif;
    margin-right: 10px;
}

.a11y-toolbar ul li button.active, .a11y-toolbar ul li button:hover {
    color: var(--secondary);
    background: var(--primary);
}

#pojo-a11y-toolbar.pojo-a11y-toolbar-right .pojo-a11y-toolbar-toggle {
    top: 150px !important;
}

#pojo-a11y-toolbar .pojo-a11y-toolbar-toggle a {
    background-color: var(--primary);
    border-radius: 8px 0 0 8px;
    opacity: 0.85;
}

/******************
* Header Account Type Label Style
******************/
.navbar-brand {
    margin-right: 0 !important;
}

.admin-margins {
    margin-top: 1.5rem !important;
}

@media (max-width: 768px) {
    .navbar-brand {
        display: flex;
        justify-content: center;
    }
}

@media (max-width: 660px) {
    .admin-margins {
        margin-top: 2rem !important;
    }
}

@media (max-width: 600px) {
    .admin-margins {
        margin-top: 2.75rem !important;
    }
}

@media (max-width: 450px) {
    .navbar-brand img {
        max-height: 40px !important;
    }

    .admin-margins {
        margin-top: 3.5rem !important;
    }
}

@media (max-width: 400px) {
    .admin-margins {
        margin-top: 4.25rem !important;
    }
}

@media (max-width: 350px) {
    .navbar-brand img {
        width: 100% !important;
    }
}

/******************
* Notification Bell Style
******************/
#notification-count {
    color: var(--secondary) !important;
    transition: color 0.2s;
}

.itg-nav-item:hover #notification-count {
    color: var(--secondary);
}

.bg-itg-primary {
    background-color: var(--primary) !important;
}

.bg-itg-primary-light {
    background-color: var(--primary-light) !important;
}

.bg-itg-primary-faded {
    background-color: rgba(var(--primary-light), 0.15) !important;
}

.notification-title, .itg-notification {
    color: var(--primary);
    text-transform: none;
}

span.itg-notification {
    line-height: 1.5em;
}

h6.itg-notification {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.2rem;
}

.notification-title-faded {
    color: var(--primary-light) !important;
    opacity: 0.8;
}

#mark-all-read {
    color: var(--primary);
    transition: color 0.3s ease;
}

#mark-all-read:hover {
    color: var(--primary-light);
}

.notification-item {
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
}

.notification-item:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.03);
}

.notification-faded {
    opacity: 0.8;
}

.text-secondary-faded {
    color: rgba(var(--bs-secondary-rgb), 0.7) !important;
}

.btn-itg-outline-primary-light {
    color: var(--primary-light);
    border-color: var(--primary-light);
}

.btn-itg-outline-primary-light:hover {
    color: #fff;
    background-color: var(--primary-light);
    border-color: var(--primary-light);
}

:root {
    --primary-faded: var(--primary-light);
}

.notification-title, .notification-text, .dropdown-menu h6, .dropdown-menu p, .dropdown-menu button, #notification-bell {
    font-family: 'Outfit', sans-serif;
}

/* Animations */
.animate__animated {
    animation-duration: 0.5s;
}

.animate__fadeIn {
    animation-name: fadeIn;
}

.animate__fadeOut {
    animation-name: fadeOut;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.notification-icon {
    width: 32px;
    height: 32px;
}

/* Custom scrollbar for notifications */
#notification-dropdown {
    max-height: 380px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 8px;
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

#notification-dropdown::-webkit-scrollbar {
    width: 5px;
}

#notification-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#notification-dropdown::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
    transition: background 0.3s ease;
}

#notification-dropdown::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

@media (max-width: 991px) {
    #notification-dropdown {
        width: 100%;
        margin: 0 auto;
    }
}

/******************
* Mega Menu Style
******************/
.mega-dropdown {
    position: fixed !important;
    top: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 90vw !important;
    max-width: 1200px !important;
    border-radius: 16px;
    margin-top: 10px;
    background: #fff;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    border: none;
    z-index: 1055;
    display: none;
    font-family: 'Outfit', sans-serif;
    max-height: 80vh;
    overflow-y: auto;
}

.mega-dropdown.show {
    display: block !important;
    animation: fadeInUp 0.3s ease-out;
}

.mega-column {
    border-right: 1px solid #e9ecef;
}

.mega-column:last-child {
    border-right: none;
}

.mega-section {
    padding: 1.5rem 1rem;
}

.mega-title {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary);
    display: flex;
    align-items: center;
    font-family: 'Outfit', sans-serif;
}

.mega-list {
    list-style: none !important;
    padding: 0;
    margin: 0;
}

.mega-list li {
    margin-bottom: 0.25rem;
    list-style: none !important;
}

.mega-list li::before {
    display: none !important;
}

.mega-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    color: #495057;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 1px solid transparent;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
}

.mega-link:hover {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1), rgba(var(--primary-rgb), 0.02));
    color: var(--primary);
    transform: translateX(5px);
    border-color: rgba(var(--primary-rgb), 0.2);
}

.mega-link svg {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.mega-link:hover svg {
    opacity: 1;
}

/* Expandable menu styles */
.mega-expandable .mega-link {
    cursor: pointer;
    user-select: none;
}

.mega-expandable .chevron-icon {
    transition: transform 0.2s ease;
}

.mega-expandable .mega-link[aria-expanded="true"] .chevron-icon {
    transform: rotate(180deg);
}

.mega-sublist {
    background: rgba(var(--primary-rgb), 0.03);
    border-radius: 8px;
    margin-top: 0.25rem;
    padding: 0.25rem 0;
    border-left: 3px solid var(--primary);
    margin-left: 1rem;
    list-style: none !important;
    display: none;
}

.mega-sublist.show {
    display: block;
}

.mega-sublist li {
    list-style: none !important;
    margin-bottom: 0.125rem;
}

.mega-sublist li::before, .mega-sublist li::marker {
    display: none !important;
    content: none !important;
}

.mega-sublist .mega-link {
    font-size: 0.85rem;
    padding: 0.375rem 0.75rem;
    margin-bottom: 0.25rem;
    list-style: none !important;
}

.mega-sublist .mega-link:hover {
    background: rgba(var(--primary-rgb), 0.08);
}

/* Navigation improvements */
.nav-link.dropdown-toggle, .nav-link.itg-nav-item {
    color: var(--primary) !important;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
}

.nav-link.dropdown-toggle:hover, .nav-link.itg-nav-item:hover, .nav-link.dropdown-toggle:focus, .nav-link.itg-nav-item:focus {
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--primary);
    text-decoration: none;
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
}

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

/* Button styles */
.btn-outline-primary, .btn-outline-danger {
    border-width: 2px;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
}

.btn-outline-primary:hover, .btn-outline-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Notification dropdown */
#notification-dropdown {
    border-radius: 12px;
    border: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    font-family: 'Outfit', sans-serif;
}

#notification-dropdown .dropdown-header {
    font-weight: 600;
    color: var(--primary);
}

/* Sublist headers */
.sublist-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.25rem 1rem;
    margin: 0.5rem 0 0.25rem 0;
    border-bottom: 1px solid rgba(var(--bs-primary-rgb), 0.2);
}

.sublist-header:first-child {
    margin-top: 0;
}

/* Loading animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .mega-dropdown {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        transform: none !important;
        width: 100% !important;
        margin: 0.5rem 0;
    }

    .mega-column {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }

    .mega-column:last-child {
        border-bottom: none;
    }

    .mega-section {
        padding: 1rem 0.75rem;
    }

    .mega-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }

    .mega-sublist .mega-link {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }

    .navbar-collapse {
        background: #fff;
        border-radius: 12px;
        margin-top: 1rem;
        padding: 1rem;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

    .navbar-collapse.show {
        display: block !important;
    }

    .navbar-nav {
        width: 100%;
    }

    .nav-item {
        margin-bottom: 0.5rem;
    }

    .btn .d-none.d-md-inline {
        display: none !important;
    }

    .navbar-brand img {
        height: 40px;
    }
}

@media (max-width: 768px) {
    .d-flex.gap-3 {
        gap: 0.75rem !important;
    }

    .mega-section {
        padding: 1rem 0.75rem;
    }

    .mega-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }

    .mega-sublist .mega-link {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
}

/******************
* Mobile Navigation Styles
******************/
/* Mobile Navigation Collapsible Styles */
.mobile-nav-toggle {
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    display: flex !important;
    align-items: center;
    padding: 0.75rem;
    border-radius: 8px;
    background: rgba(var(--primary-rgb), 0.05);
    margin-bottom: 0.75rem;
}

.mobile-nav-toggle:hover {
    background: rgba(var(--primary-rgb), 0.1);
}

.mobile-nav-toggle[aria-expanded="true"] {
    background: rgba(var(--primary-rgb), 0.15);
}

.mobile-chevron {
    transition: transform 0.3s ease;
    margin-left: auto;
    opacity: 0.7;
}

.mobile-nav-toggle[aria-expanded="true"] .mobile-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

.mobile-nav-toggle[aria-expanded="false"] .mobile-chevron {
    transform: rotate(0deg);
}

/* Smooth collapse animations */
.collapse {
    transition: height 0.35s ease, opacity 0.2s ease;
}

.collapsing {
    transition: height 0.35s ease;
}

/* Mobile section styling */
.mobile-nav-section {
    border: 1px solid rgba(var(--primary-rgb), 0.1);
    border-radius: 12px;
    padding: 1rem;
    background: rgba(var(--primary-rgb), 0.02);
    margin-bottom: 1rem;
}

.mobile-nav-section:last-of-type {
    margin-bottom: 1.5rem;
}

/* Mobile nav title */
.mobile-nav-title {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: capitalize;
    margin-bottom: 0 !important;
    display: flex;
    align-items: center;
    font-family: 'Outfit', sans-serif;
}

/* Adjust spacing when collapsed */
.mobile-nav-section .collapse:not(.show) + .mobile-nav-title {
    margin-bottom: 0;
}

.mobile-nav-section .collapse.show {
    margin-top: 0.75rem;
}

/* Mobile nav list */
.mobile-nav-list {
    list-style: none !important;
    padding: 0;
    margin: 0;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    padding: 0.5rem;
}

.mobile-nav-list li {
    margin-bottom: 0.25rem;
    list-style: none !important;
}

.mobile-nav-list li:last-child {
    margin-bottom: 0;
}

/* Mobile nav links */
.mobile-nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    color: #495057;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-family: 'Outfit', sans-serif;
    background: transparent;
    border: 1px solid transparent;
}

.mobile-nav-link:hover, .mobile-nav-link:focus {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    text-decoration: none;
    border-color: rgba(var(--primary-rgb), 0.2);
    transform: translateX(3px);
}

.mobile-nav-link svg {
    margin-right: 0.75rem;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.mobile-nav-link:hover svg {
    opacity: 1;
}

/* Mobile subsections */
.mobile-nav-subsection {
    margin: 0.75rem 0 0.25rem 0;
}

.mobile-nav-subtitle {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.25rem 0.75rem;
    display: block;
    background: rgba(var(--bs-primary-rgb), 0.1);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--primary);
}

.mobile-nav-sublink {
    padding-left: 1.5rem !important;
    font-size: 0.85rem;
    background: rgba(var(--bs-primary-rgb), 0.05);
    margin-bottom: 0.25rem;
    border-radius: 6px;
}

.mobile-nav-sublink:hover {
    background: rgba(var(--bs-primary-rgb), 0.12) !important;
}

.mobile-nav-sublink svg {
    width: 14px !important;
    height: 14px !important;
}

/* Actions section */
.mobile-nav-actions {
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 12px;
    padding: 1rem;
    background: rgba(220, 53, 69, 0.02);
}

.logout-link {
    color: var(--primary-red) !important;
    font-weight: 600;
    background: rgba(var(--primary-red-rgb), 0.05);
    border: 1px solid rgba(var(--primary-red-rgb), 0.2);
}

.logout-link:hover {
    background: rgba(var(--primary-red-rgb), 0.1) !important;
    color: var(--primary-red) !important;
    border-color: rgba(var(--primary-red-rgb), 0.3);
    transform: translateX(3px);
}

/* Loading and focus states */
.mobile-nav-section.loading {
    opacity: 0.7;
    pointer-events: none;
}

.mobile-nav-section.loading .mobile-nav-toggle {
    background: rgba(var(--bs-primary-rgb), 0.1);
}

.mobile-nav-toggle:focus, .mobile-nav-link:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Animation for smooth transitions */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.collapse.show .mobile-nav-list {
    animation: slideDown 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .mobile-nav-section {
        padding: 0.75rem;
    }

    .mobile-nav-toggle {
        font-size: 0.85rem;
        padding: 0.65rem;
    }

    .mobile-nav-link {
        padding: 0.65rem;
        font-size: 0.9rem;
    }
}