/* ===== Mobile Menu Styles ===== */

/* Hamburger Menu Button */
.mobile-menu-toggle {
    display: none;
    position: relative;
    width: 44px;
    height: 44px;
    border: none;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 10px;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.mobile-menu-toggle:hover {
    background: var(--bg-tertiary, #e9ecef);
    transform: scale(1.05);
}

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

/* Hamburger Lines */
.mobile-menu-toggle .hamburger-line {
    width: 24px;
    height: 2.5px;
    background: var(--text-primary, #212529);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* Animated Hamburger to X */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Mobile Menu Container */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background: var(--bg-primary, #ffffff);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

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

/* Dark Theme Support */
[data-theme="dark"] .mobile-menu {
    background: var(--bg-primary, #0f0f0f);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .mobile-menu-toggle {
    background: var(--bg-secondary, #1a1a1a);
}

[data-theme="dark"] .mobile-menu-toggle:hover {
    background: var(--bg-tertiary, #2a2a2a);
}

/* Mobile Menu Header */
.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color, #dee2e6);
    background: var(--bg-secondary, #f8f9fa);
}

.mobile-menu-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary, #212529);
    text-decoration: none;
}

.mobile-menu-brand-icon {
    font-size: 1.5rem;
}

.mobile-menu-close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-secondary, #495057);
    font-size: 1.5rem;
    transition: all 0.2s ease;
}

.mobile-menu-close:hover {
    background: var(--bg-tertiary, #e9ecef);
    color: var(--text-primary, #212529);
}

/* Mobile Menu Content */
.mobile-menu-content {
    flex: 1;
    padding: 20px;
    padding-bottom: 80px;
}

/* Mobile Menu Links */
.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--text-primary, #212529);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.mobile-menu-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-link:hover::before,
.mobile-menu-link.active::before {
    transform: scaleY(1);
}

.mobile-menu-link:hover {
    background: var(--bg-secondary, #f8f9fa);
    color: var(--brand-primary, #4361ee);
    transform: translateX(4px);
}

.mobile-menu-link.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: var(--brand-primary, #4361ee);
    font-weight: 600;
}

.mobile-menu-link-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

/* Mobile Menu Divider */
.mobile-menu-divider {
    height: 1px;
    background: var(--border-color, #dee2e6);
    margin: 16px 0;
}

/* Mobile Menu Section Title */
.mobile-menu-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-tertiary, #6c757d);
    letter-spacing: 0.5px;
    padding: 12px 16px 8px;
    margin-top: 8px;
}

/* Mobile Menu Progress Card */
.mobile-menu-progress {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    color: white;
}

.mobile-menu-progress-title {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 8px;
}

.mobile-menu-progress-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-progress-number {
    font-size: 2rem;
    font-weight: 800;
}

.mobile-menu-progress-label {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Mobile Menu Footer */
.mobile-menu-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color, #dee2e6);
    background: var(--bg-secondary, #f8f9fa);
}

.mobile-menu-footer-text {
    font-size: 0.85rem;
    color: var(--text-secondary, #495057);
    text-align: center;
    margin: 0;
}

/* Animation Classes */
.mobile-menu-link {
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.mobile-menu-link:nth-child(1) { animation-delay: 0.05s; }
.mobile-menu-link:nth-child(2) { animation-delay: 0.1s; }
.mobile-menu-link:nth-child(3) { animation-delay: 0.15s; }
.mobile-menu-link:nth-child(4) { animation-delay: 0.2s; }
.mobile-menu-link:nth-child(5) { animation-delay: 0.25s; }
.mobile-menu-link:nth-child(6) { animation-delay: 0.3s; }
.mobile-menu-link:nth-child(7) { animation-delay: 0.35s; }
.mobile-menu-link:nth-child(8) { animation-delay: 0.4s; }

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
}

/* Scrollbar Styles for Mobile Menu */
.mobile-menu::-webkit-scrollbar {
    width: 6px;
}

.mobile-menu::-webkit-scrollbar-track {
    background: transparent;
}

.mobile-menu::-webkit-scrollbar-thumb {
    background: var(--border-color, #dee2e6);
    border-radius: 3px;
}

.mobile-menu::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary, #6c757d);
}

/* Prevent body scroll when menu is open */
body.mobile-menu-open {
    overflow: hidden;
}

/* Tablet adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
    .mobile-menu {
        width: 320px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .mobile-menu {
        width: 100%;
        max-width: 100vw;
    }

    .mobile-menu-header {
        padding: 16px;
    }

    .mobile-menu-content {
        padding: 16px;
    }

    .mobile-menu-footer {
        padding: 16px;
    }
}

/* Accessibility improvements */
.mobile-menu-toggle:focus,
.mobile-menu-close:focus,
.mobile-menu-link:focus {
    outline: 2px solid var(--brand-primary, #4361ee);
    outline-offset: 2px;
}

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