/* ============================================
   MyBooking.ai - User Menu Additional Styles
   For Desktop Auth Buttons and Mobile User Dropdown
   ============================================ */

/* ============================================
   Desktop Auth Buttons (for non-authenticated users)
   ============================================ */

@media (min-width: 993px) {
    .header-auth-buttons {
        display: flex;
        align-items: center;
        gap: var(--desktop-space-2, 8px);
    }
    
    .header-auth-btn {
        display: flex;
        align-items: center;
        gap: var(--desktop-space-2, 8px);
        padding: 8px 16px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 500;
        text-decoration: none;
        transition: all 0.2s ease;
    }
    
    .header-auth-btn--login {
        background: transparent;
        color: #374151;
        border: 1px solid #e5e7eb;
    }
    
    .header-auth-btn--login:hover {
        background: #f3f4f6;
        color: #111827;
        border-color: #d1d5db;
    }
    
    .header-auth-btn--register {
        background: linear-gradient(135deg, #0ea5e9, #6366f1);
        color: white;
        border: none;
    }
    
    .header-auth-btn--register:hover {
        background: linear-gradient(135deg, #0284c7, #4f46e5);
        color: white;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
    }
    
    .header-auth-btn i {
        font-size: 16px;
    }
    
    /* Header Logo for non-authenticated view */
    .header-logo {
        display: flex;
        align-items: center;
        gap: 8px;
        text-decoration: none;
        color: #111827;
        margin-right: 16px;
    }
    
    .header-logo__icon {
        width: 36px;
        height: 36px;
        background: linear-gradient(135deg, #0ea5e9, #6366f1);
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 18px;
    }
    
    .header-logo__text {
        font-size: 18px;
        font-weight: 700;
        background: linear-gradient(135deg, #0ea5e9, #6366f1);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
}

/* ============================================
   Mobile User Menu Overlay
   ============================================ */

@media (max-width: 992px) {
    .mobile-user-menu-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 1003;
        opacity: 0;
        visibility: hidden;
        transition: all 0.25s ease;
    }
    
    .mobile-user-menu-overlay.is-active {
        opacity: 1;
        visibility: visible;
    }
}

/* ============================================
   Mobile User Dropdown
   ============================================ */

@media (max-width: 992px) {
    .mobile-user-dropdown {
        position: fixed;
        top: calc(60px + env(safe-area-inset-top, 0px) + 8px);
        right: 8px;
        width: calc(100% - 16px);
        max-width: 320px;
        background: white;
        border-radius: 16px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
        z-index: 1004;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px) scale(0.95);
        transform-origin: top right;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        overflow: hidden;
    }
    
    .mobile-user-dropdown.is-active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
    }
    
    /* Header */
    .mobile-user-dropdown__header {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 16px;
        background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    }
    
    .mobile-user-dropdown__header--guest {
        background: linear-gradient(135deg, #e0f2fe, #dbeafe);
    }
    
    .mobile-user-dropdown__avatar {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: linear-gradient(135deg, #0ea5e9, #6366f1);
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-weight: 600;
        font-size: 16px;
        flex-shrink: 0;
    }
    
    .mobile-user-dropdown__avatar--guest {
        background: linear-gradient(135deg, #94a3b8, #64748b);
    }
    
    .mobile-user-dropdown__avatar--guest i {
        font-size: 24px;
    }
    
    .mobile-user-dropdown__info {
        flex: 1;
        min-width: 0;
    }
    
    .mobile-user-dropdown__name {
        font-weight: 600;
        font-size: 16px;
        color: #111827;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .mobile-user-dropdown__email {
        font-size: 13px;
        color: #6b7280;
        margin: 2px 0 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .mobile-user-dropdown__role {
        display: inline-block;
        margin-top: 4px;
        padding: 2px 8px;
        background: #0ea5e9;
        color: white;
        font-size: 11px;
        border-radius: 999px;
        font-weight: 500;
    }
    
    /* Divider */
    .mobile-user-dropdown__divider {
        height: 1px;
        background: #e5e7eb;
        margin: 4px 0;
    }
    
    /* Menu Items */
    .mobile-user-dropdown__item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        color: #374151;
        text-decoration: none;
        font-size: 15px;
        font-weight: 500;
        transition: all 0.15s ease;
        border: none;
        background: none;
        width: 100%;
        text-align: left;
        cursor: pointer;
    }
    
    .mobile-user-dropdown__item:hover,
    .mobile-user-dropdown__item:active {
        background: #f3f4f6;
        color: #111827;
    }
    
    .mobile-user-dropdown__item i {
        width: 20px;
        text-align: center;
        color: #9ca3af;
        font-size: 18px;
    }
    
    .mobile-user-dropdown__item:hover i,
    .mobile-user-dropdown__item:active i {
        color: #0ea5e9;
    }
    
    /* Primary Item (Login) */
    .mobile-user-dropdown__item--primary {
        background: linear-gradient(135deg, #0ea5e9, #0284c7);
        color: white;
        margin: 8px 12px;
        border-radius: 10px;
        width: calc(100% - 24px);
    }
    
    .mobile-user-dropdown__item--primary:hover,
    .mobile-user-dropdown__item--primary:active {
        background: linear-gradient(135deg, #0284c7, #0369a1);
        color: white;
    }
    
    .mobile-user-dropdown__item--primary i {
        color: white;
    }
    
    /* Danger Item (Logout) */
    .mobile-user-dropdown__item--danger {
        color: #ef4444;
    }
    
    .mobile-user-dropdown__item--danger:hover,
    .mobile-user-dropdown__item--danger:active {
        background: #fef2f2;
        color: #dc2626;
    }
    
    .mobile-user-dropdown__item--danger i {
        color: #ef4444;
    }
    
    /* Logout Form */
    .mobile-user-dropdown__logout-form {
        margin: 0;
    }
    
    /* Language Selector in Dropdown */
    .mobile-user-dropdown__language {
        padding: 12px 16px;
    }
    
    .mobile-user-dropdown__language form {
        display: flex;
        gap: 8px;
    }
    
    .mobile-user-dropdown__language select {
        flex: 1;
        height: 40px;
        padding: 0 12px;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        font-size: 14px;
        background: white;
    }
    
    .mobile-user-dropdown__language .btn {
        width: 40px;
        height: 40px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* User Button in Header */
    .mobile-header__user-btn {
        padding: 0 !important;
    }
    
    .mobile-header__user-avatar {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: linear-gradient(135deg, #0ea5e9, #6366f1);
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-weight: 600;
        font-size: 13px;
    }
    
    .mobile-header__user-btn--guest {
        color: #6b7280;
    }
    
    .mobile-header__user-btn--guest i {
        font-size: 28px;
    }
}

/* ============================================
   Dark Mode Support
   ============================================ */

@media (prefers-color-scheme: dark) {
    @media (max-width: 992px) {
        .mobile-user-dropdown {
            background: #1e293b;
        }
        
        .mobile-user-dropdown__header {
            background: linear-gradient(135deg, #1e293b, #334155);
        }
        
        .mobile-user-dropdown__header--guest {
            background: linear-gradient(135deg, #1e3a5f, #1e40af);
        }
        
        .mobile-user-dropdown__name {
            color: #f1f5f9;
        }
        
        .mobile-user-dropdown__email {
            color: #94a3b8;
        }
        
        .mobile-user-dropdown__divider {
            background: #334155;
        }
        
        .mobile-user-dropdown__item {
            color: #e2e8f0;
        }
        
        .mobile-user-dropdown__item:hover,
        .mobile-user-dropdown__item:active {
            background: #334155;
            color: #f1f5f9;
        }
        
        .mobile-user-dropdown__item i {
            color: #64748b;
        }
        
        .mobile-user-dropdown__item--danger {
            color: #f87171;
        }
        
        .mobile-user-dropdown__item--danger:hover,
        .mobile-user-dropdown__item--danger:active {
            background: rgba(239, 68, 68, 0.1);
            color: #fca5a5;
        }
        
        .mobile-user-dropdown__language select {
            background: #334155;
            border-color: #475569;
            color: #e2e8f0;
        }
    }
    
    @media (min-width: 993px) {
        .header-auth-btn--login {
            background: transparent;
            color: #e2e8f0;
            border-color: #475569;
        }
        
        .header-auth-btn--login:hover {
            background: #334155;
            color: #f1f5f9;
            border-color: #64748b;
        }
        
        .header-logo {
            color: #f1f5f9;
        }
    }
}

/* ============================================
   Animation for Menu Items
   ============================================ */

@media (max-width: 992px) {
    .mobile-user-dropdown__item {
        opacity: 0;
        transform: translateX(-10px);
    }
    
    .mobile-user-dropdown.is-active .mobile-user-dropdown__item {
        opacity: 1;
        transform: translateX(0);
    }
    
    .mobile-user-dropdown.is-active .mobile-user-dropdown__item:nth-child(1) { transition-delay: 50ms; }
    .mobile-user-dropdown.is-active .mobile-user-dropdown__item:nth-child(2) { transition-delay: 75ms; }
    .mobile-user-dropdown.is-active .mobile-user-dropdown__item:nth-child(3) { transition-delay: 100ms; }
    .mobile-user-dropdown.is-active .mobile-user-dropdown__item:nth-child(4) { transition-delay: 125ms; }
    .mobile-user-dropdown.is-active .mobile-user-dropdown__item:nth-child(5) { transition-delay: 150ms; }
    .mobile-user-dropdown.is-active .mobile-user-dropdown__item:nth-child(6) { transition-delay: 175ms; }
    .mobile-user-dropdown.is-active .mobile-user-dropdown__item:nth-child(7) { transition-delay: 200ms; }
    .mobile-user-dropdown.is-active .mobile-user-dropdown__item:nth-child(8) { transition-delay: 225ms; }
    
    .mobile-user-dropdown__header,
    .mobile-user-dropdown__divider,
    .mobile-user-dropdown__language,
    .mobile-user-dropdown__logout-form {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ============================================
   Accessibility - Reduce Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .mobile-user-dropdown,
    .mobile-user-dropdown__item,
    .mobile-user-menu-overlay {
        transition: none !important;
    }
    
    .mobile-user-dropdown__item {
        opacity: 1 !important;
        transform: none !important;
    }
}