/**
 * Mobile Menu Styles
 *
 * Responsive mobile navigation menu with slide-in drawer
 * and hamburger toggle button
 */

/* ============================================
   MOBILE MENU TRIGGER BUTTON
   ============================================ */

.mobile-menu-trigger {
    position: fixed;
    bottom: 90px; /* Adjusted to be above bottom nav */
    right: 20px;
    z-index: 9999;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%); /* Blue to match theme */
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    box-shadow: 0 4px 16px rgba(13, 110, 253, 0.4);
    color: white;
    font-weight: 600;
    font-size: 14px;
    display: none; /* Hidden by default, shown on mobile via media query */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-trigger:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.6);
}

.mobile-menu-trigger:active {
    transform: scale(0.95);
}

/* Hamburger Icon */
.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 24px;
}

.hamburger-icon span {
    display: block;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-trigger.active .hamburger-icon span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-trigger.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.mobile-menu-trigger.active .hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ============================================
   MOBILE MENU OVERLAY
   ============================================ */

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   MOBILE MENU WRAPPER
   ============================================ */

.mobile-menu-wrapper {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100%;
    background-color: #ffffff;
    z-index: 1001;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mobile-menu-wrapper.active {
    right: 0;
}

/* ============================================
   MOBILE MENU HEADER
   ============================================ */

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mobile-menu-logo img {
    height: 40px;
    width: auto;
}

.mobile-menu-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* ============================================
   MOBILE MENU USER SECTION
   ============================================ */

.mobile-menu-user-section {
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.mobile-user-info,
.mobile-guest-info {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #495057;
}

.mobile-user-info i,
.mobile-guest-info i {
    font-size: 20px;
    color: #0d6efd;
}

/* ============================================
   MOBILE MENU NAVIGATION
   ============================================ */

.mobile-menu-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

/* Custom scrollbar */
.mobile-menu-nav::-webkit-scrollbar {
    width: 6px;
}

.mobile-menu-nav::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.mobile-menu-nav::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.mobile-menu-nav::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ============================================
   MOBILE MENU ITEMS
   ============================================ */

.mobile-menu-item {
    border-bottom: 1px solid #e9ecef;
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #212529;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.mobile-menu-link:hover {
    background-color: #f8f9fa;
    color: #0d6efd;
    padding-left: 25px;
    border-left: 3px solid #0d6efd;
}

.mobile-menu-link:active {
    background-color: #e9ecef;
}

.mobile-menu-link i {
    width: 24px;
    color: #0d6efd;
}

/* ============================================
   MOBILE ACCORDION STYLES
   ============================================ */

.mobile-accordion-item {
    border: none;
    border-bottom: 1px solid #e9ecef;
    background: white;
}

.mobile-accordion-button {
    padding: 15px 20px;
    background-color: white;
    border: none;
    font-weight: 500;
    color: #212529;
    box-shadow: none !important;
    position: relative;
    transition: all 0.3s ease;
}

.mobile-accordion-button:hover {
    background-color: #f8f9fa;
}

.mobile-accordion-button:not(.collapsed) {
    background-color: #f0f7ff;
    color: #0d6efd;
}

.mobile-accordion-button i {
    width: 24px;
    color: #0d6efd;
}

/* Hide default Bootstrap arrow */
.mobile-accordion-button::after {
    display: none;
}

/* Custom chevron arrow */
.accordion-arrow {
    font-size: 14px;
    transition: transform 0.3s ease;
    color: #6c757d;
}

.mobile-accordion-button:not(.collapsed) .accordion-arrow {
    transform: rotate(180deg);
    color: #0d6efd;
}

.mobile-accordion-body {
    padding: 0;
    background-color: #fafbfc;
}

/* Smooth collapse animation */
.accordion-collapse {
    transition: height 0.35s ease;
}

/* Sub-Accordion Styles */
.mobile-sub-accordion-item {
    border: none;
    border-bottom: 1px solid #e9ecef;
}

.mobile-sub-accordion-button {
    padding: 12px 20px 12px 40px;
    background-color: #fafbfc;
    border: none;
    font-weight: 400;
    font-size: 14px;
    color: #495057;
    box-shadow: none !important;
}

.mobile-sub-accordion-button:not(.collapsed) {
    background-color: #e9ecef;
    color: #0d6efd;
}

.mobile-sub-accordion-button i {
    width: 20px;
    font-size: 14px;
}

.mobile-sub-accordion-body {
    padding: 0;
    background-color: white;
}

/* ============================================
   MOBILE MENU LIST
   ============================================ */

.mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}

.mobile-menu-list li {
    border-bottom: 1px solid #f1f3f5;
}

.mobile-menu-list li:last-child {
    border-bottom: none;
}

.mobile-submenu-link {
    display: flex;
    align-items: center;
    padding: 12px 20px 12px 40px;
    color: #495057;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    position: relative;
}

.mobile-submenu-link i {
    width: 20px;
    font-size: 14px;
    color: #6c757d;
    transition: color 0.2s ease;
}

.mobile-submenu-link:hover {
    background-color: #f8f9fa;
    color: #0d6efd;
    padding-left: 44px;
}

.mobile-submenu-link:hover i {
    color: #0d6efd;
}

.mobile-submenu-link:active {
    background-color: #e9ecef;
}

/* Add subtle indicator for active item */
.mobile-submenu-link.active {
    background-color: #e7f3ff;
    color: #0d6efd;
    font-weight: 600;
    border-left: 3px solid #0d6efd;
}

.mobile-submenu-link.active i {
    color: #0d6efd;
}

/* ============================================
   MOBILE MENU FOOTER
   ============================================ */

.mobile-menu-footer {
    padding: 20px;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Show mobile menu on tablets and smaller */
@media (max-width: 991.98px) {
    .mobile-menu-trigger {
        display: flex;
    }
}

/* Adjust mobile menu width on smaller phones */
@media (max-width: 576px) {
    .mobile-menu-wrapper {
        width: 90%;
        max-width: 320px;
    }

    .mobile-menu-trigger {
        bottom: 85px;
        right: 15px;
        width: 50px;
        height: 50px;
    }

    .menu-text {
        display: none !important;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes slideInRight {
    from {
        right: -100%;
    }
    to {
        right: 0;
    }
}

@keyframes slideOutRight {
    from {
        right: 0;
    }
    to {
        right: -100%;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.mobile-menu-trigger:focus,
.mobile-menu-close:focus,
.mobile-menu-link:focus,
.mobile-accordion-button:focus,
.mobile-submenu-link:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .mobile-menu-trigger,
    .mobile-menu-wrapper,
    .mobile-menu-overlay,
    .mobile-menu-link,
    .mobile-submenu-link,
    .mobile-menu-close {
        transition: none;
        animation: none;
    }
}

/* ============================================
   DARK MODE SUPPORT (OPTIONAL)
   ============================================ */

@media (prefers-color-scheme: dark) {
    .mobile-menu-wrapper {
        background-color: #1a1a1a;
    }

    .mobile-menu-user-section,
    .mobile-menu-footer {
        background-color: #2a2a2a;
        border-color: #3a3a3a;
    }

    .mobile-accordion-body {
        background-color: #242424;
    }

    .mobile-menu-link,
    .mobile-accordion-button,
    .mobile-submenu-link {
        color: #e0e0e0;
    }

    .mobile-menu-item,
    .mobile-accordion-item,
    .mobile-sub-accordion-item,
    .mobile-menu-list li {
        border-color: #3a3a3a;
    }

    .mobile-accordion-button:not(.collapsed) {
        background-color: #2a2a2a;
    }

    .mobile-sub-accordion-button {
        background-color: #242424;
    }

    .mobile-sub-accordion-button:not(.collapsed) {
        background-color: #2a2a2a;
    }
}
