/* Mobile Navigation System */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #E8DCC4; /* Force light color matching theme */
    cursor: pointer;
    padding: 8px;
    margin-left: auto; /* Push to right */
    border-radius: 8px;
    transition: background-color 0.2s;
    z-index: 101; /* Ensure above other navbar elements */
}

.mobile-menu-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(8px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.mobile-nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100%;
    background: #1a1a1a;
    background: var(--bg-secondary, #1a1a1a);
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.5);
}

.mobile-nav-menu.active {
    transform: translateX(0);
}

.mobile-nav-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 20px;
    color: var(--text-primary, #fff);
}

.mobile-nav-close {
    background: none;
    border: none;
    color: var(--text-secondary, #aaa);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.mobile-nav-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #fff);
}

.mobile-nav-links {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.mobile-nav-link {
    font-family: 'Quicksand', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary, #aaa);
    text-decoration: none;
    padding: 16px;
    border-radius: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-nav-link svg {
    opacity: 0.7;
    transition: opacity 0.2s;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background: rgba(212, 165, 116, 0.1);
    color: var(--accent-gold, #d4a574);
}

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

.mobile-nav-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    user-select: none;
}

.mobile-nav-link.disabled:hover {
    background: transparent;
    color: var(--text-secondary, #aaa);
}

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

/* Mobile Nav Divider */
.mobile-nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 12px 0;
}

/* Logout Link Styling */
.mobile-nav-link.logout-link {
    color: #ef4444;
    margin-top: auto;
}

.mobile-nav-link.logout-link:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.mobile-nav-link.logout-link svg {
    stroke: currentColor;
}

.mobile-nav-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    margin-left: auto;
}

/* Mobile Search Button & Expandable Search */
.mobile-search-btn {
    display: none;
    background: none;
    border: none;
    color: #E8DCC4;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.mobile-search-btn:hover {
    background-color: rgba(212, 165, 116, 0.1);
    color: #d4a574;
}

.mobile-search-btn svg {
    display: block;
}

/* Mobile Search Overlay - Expands from the search button */
.mobile-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.mobile-search-container {
    padding: 16px 20px;
    background: rgba(3, 3, 3, 0.97);
    border-bottom: 1px solid rgba(168, 107, 62, 0.25);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-search-overlay.active .mobile-search-container {
    transform: translateY(0);
}

.mobile-search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.mobile-search-input-wrapper .search-icon {
    position: absolute;
    left: 14px;
    color: rgba(236, 207, 131, 0.7);
    pointer-events: none;
    filter: drop-shadow(0 0 4px rgba(168, 107, 62, 0.3));
    transition: all 0.3s ease;
}

.mobile-search-input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    background: rgba(10, 9, 8, 0.8);
    border: 1px solid rgba(168, 107, 62, 0.3);
    border-radius: 14px;
    color: #f4f1ea;
    font-size: 16px; /* Prevent iOS zoom */
    font-family: 'Quicksand', sans-serif;
    transition: all 0.3s ease;
}

.mobile-search-input::placeholder {
    color: rgba(196, 181, 160, 0.5);
}

.mobile-search-input:focus {
    outline: none;
    border-color: rgba(212, 165, 116, 0.5);
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.3),
        0 0 0 3px rgba(168, 107, 62, 0.15);
}

.mobile-search-input:focus + .search-icon,
.mobile-search-input-wrapper:focus-within .search-icon {
    color: rgba(236, 207, 131, 0.9);
    filter: drop-shadow(0 0 8px rgba(236, 207, 131, 0.5));
}

.mobile-search-close {
    background: none;
    border: none;
    color: rgba(196, 181, 160, 0.8);
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mobile-search-close:hover {
    background: rgba(212, 165, 116, 0.1);
    color: #d4a574;
}

/* Mobile Search Results Area */
.mobile-search-results {
    padding: 12px 20px 20px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
}

.mobile-search-overlay.active .mobile-search-results {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Search Results Scrollbar */
.mobile-search-results::-webkit-scrollbar {
    width: 6px;
}

.mobile-search-results::-webkit-scrollbar-track {
    background: rgba(212, 165, 116, 0.05);
    border-radius: 10px;
}

.mobile-search-results::-webkit-scrollbar-thumb {
    background: rgba(212, 165, 116, 0.3);
    border-radius: 10px;
}

/* Mobile search result items styling */
.mobile-search-results .search-result-item {
    padding: 14px 12px;
    margin-bottom: 6px;
    background: rgba(20, 18, 16, 0.6);
    border: 1px solid rgba(168, 107, 62, 0.15);
    border-radius: 12px;
}

.mobile-search-results .search-result-item:active {
    transform: scale(0.98);
    background: rgba(212, 165, 116, 0.15);
}

.mobile-search-results .search-results-header {
    padding: 8px 0 16px;
    border-bottom: 1px solid rgba(168, 107, 62, 0.15);
    margin-bottom: 12px;
}

.mobile-search-results .search-results-count {
    font-size: 13px;
    color: rgba(196, 181, 160, 0.7);
    font-weight: 600;
}

.mobile-search-results .search-group-label {
    font-size: 11px;
    font-weight: 700;
    color: rgba(212, 165, 116, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 0 8px;
}

/* Empty/Loading states for mobile */
.mobile-search-results .search-no-results,
.mobile-search-results .search-loading,
.mobile-search-results .search-error {
    padding: 60px 20px;
    text-align: center;
}

.mobile-search-results .search-no-results svg {
    opacity: 0.3;
    margin-bottom: 16px;
}

.mobile-search-results .search-no-results p {
    color: rgba(196, 181, 160, 0.8);
    font-size: 15px;
    margin-bottom: 8px;
}

.mobile-search-results .search-hint {
    color: rgba(196, 181, 160, 0.5);
    font-size: 13px;
}

/* Mobile search hint when empty */
.mobile-search-hint {
    padding: 40px 20px;
    text-align: center;
    color: rgba(196, 181, 160, 0.5);
}

.mobile-search-hint svg {
    display: block;
    margin: 0 auto 16px;
    opacity: 0.3;
}

.mobile-search-hint p {
    font-size: 14px;
    line-height: 1.6;
}

.mobile-search-hint-shortcut {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(212, 165, 116, 0.1);
    border-radius: 8px;
    font-size: 13px;
    color: rgba(212, 165, 116, 0.8);
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }
    
    .mobile-search-btn {
        display: flex;
    }
    
    /* Hide desktop nav elements on mobile to prevent overflow */
    .nav-right .search-container,
    .nav-right .user-menu-container {
        display: none !important;
    }
    
    /* Ensure nav-right takes available space for proper alignment */
    .nav-right {
        flex: 1;
        justify-content: flex-end;
        gap: 0.5rem;
    }
}
