/* Universal 3-Line Hamburger Menu System */
/* This CSS provides consistent menu styling across all pages */

.universal-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    border-radius: 0 0 16px 16px;
}

.universal-nav-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.universal-back-btn, .universal-menu-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.universal-back-btn:hover, .universal-menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 3-Line Hamburger Icon */
.hamburger-icon {
    width: 24px;
    height: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    cursor: pointer;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.universal-menu-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.universal-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.universal-menu-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Menu Overlay */
.universal-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

/* Mobile Menu Panel */
.universal-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100vh;
    background: linear-gradient(145deg, #f8f9ff 0%, #ffffff 50%, #f0f4ff 100%);
    z-index: 300;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 32px rgba(102, 126, 234, 0.2);
    display: flex;
    flex-direction: column;
    border-radius: 20px 0 0 20px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.universal-menu.active {
    right: 0;
}

.universal-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: white;
    border-radius: 20px 0 0 0;
    position: relative;
    overflow: hidden;
}

.universal-menu-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        transparent 30%, 
        transparent 70%, 
        rgba(255, 255, 255, 0.1) 100%);
    pointer-events: none;
}

.universal-menu-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.universal-menu-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.6rem;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.universal-menu-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Menu Content */
.universal-menu-content {
    flex: 1;
    padding: 1.5rem 0;
    overflow-y: auto;
}

.universal-menu-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    margin: 0.5rem 1rem;
    color: #4a5568;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(102, 126, 234, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.universal-menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(102, 126, 234, 0.1), 
        transparent);
    transition: left 0.5s ease;
}

.universal-menu-item:hover::before {
    left: 100%;
}

.universal-menu-item:hover {
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.1) 0%, 
        rgba(118, 75, 162, 0.1) 100%);
    text-decoration: none;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.2);
}

.universal-menu-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.universal-menu-item i {
    width: 24px;
    margin-right: 1rem;
    font-size: 1.1rem;
    text-align: center;
}

.universal-menu-item span {
    font-size: 1rem;
    font-weight: 500;
}

/* Menu Sections */
.universal-menu-section {
    margin: 2rem 1.5rem 1rem 1.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.1) 0%, 
        rgba(118, 75, 162, 0.1) 100%);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    text-align: center;
}

/* User Info Section */
.universal-menu-user {
    padding: 1.5rem;
    margin: 1rem;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.9) 0%, 
        rgba(248, 250, 252, 0.9) 100%);
    border-radius: 20px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.1);
}

.universal-menu-user-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: #2d3748;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.universal-menu-user-email {
    font-size: 0.85rem;
    color: #718096;
    margin-bottom: 0.75rem;
}

.universal-menu-user-role {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Logout Button */
.universal-menu-logout {
    margin-top: auto;
    padding: 1.5rem;
}

.universal-logout-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 8px 25px rgba(229, 62, 62, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.universal-logout-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent);
    transition: left 0.5s ease;
}

.universal-logout-btn:hover::before {
    left: 100%;
}

.universal-logout-btn:hover {
    background: linear-gradient(135deg, #c53030 0%, #9c2626 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(229, 62, 62, 0.4);
}

/* Desktop - Hide on larger screens */
@media (min-width: 769px) {
    .universal-nav-bar {
        display: none;
    }
    
    .universal-menu-overlay,
    .universal-menu {
        display: none;
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .universal-menu {
        width: 300px;
        right: -300px;
        border-radius: 16px 0 0 16px;
    }
    
    .universal-nav-title {
        font-size: 1.1rem;
    }
    
    .universal-menu-header {
        padding: 1.25rem;
        border-radius: 16px 0 0 0;
    }
    
    .universal-menu-item {
        margin: 0.25rem 0.75rem;
        padding: 0.875rem 1.25rem;
        border-radius: 14px;
    }
    
    .universal-menu-user {
        margin: 0.75rem;
        padding: 1.25rem;
        border-radius: 16px;
    }
}

/* Animation for smooth transitions */
@keyframes slideInRight {
    from {
        right: -300px;
    }
    to {
        right: 0;
    }
}

@keyframes slideOutRight {
    from {
        right: 0;
    }
    to {
        right: -300px;
    }
}

/* Focus states for accessibility */
.universal-back-btn:focus,
.universal-menu-btn:focus,
.universal-menu-close:focus,
.universal-menu-item:focus,
.universal-logout-btn:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Loading state */
.universal-menu-loading {
    padding: 2rem;
    text-align: center;
    color: #666;
}

.universal-menu-loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dark Mode Toggle in Menu */
.dark-mode-toggle-item {
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.dark-mode-toggle-item:hover {
    text-decoration: none !important;
}

.dark-mode-switch {
    margin-left: auto;
    position: relative;
    width: 50px;
    height: 26px;
}

.dark-mode-checkbox {
    opacity: 0;
    width: 0;
    height: 0;
}

.dark-mode-switch-label {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ccc;
    border-radius: 26px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dark-mode-switch-label:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dark-mode-checkbox:checked + .dark-mode-switch-label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.dark-mode-checkbox:checked + .dark-mode-switch-label:before {
    transform: translateX(24px);
}

.dark-mode-switch-label:hover {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Prevent text selection on dark mode toggle */
.dark-mode-toggle-item {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Ensure the toggle switch doesn't interfere with click */
.dark-mode-switch * {
    pointer-events: none;
}