/* Mobile Menu Styles - Shared Component */
/* Compatible with both custom CSS classes and utility classes */

/* Mobile Menu Button */
.nav-mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10001;
}

.nav-mobile-toggle span {
    width: 24px;
    height: 2px;
    background: var(--neutral-900, #1C1C19);
    border-radius: 1px;
    transition: all 0.3s ease;
    transform-origin: 1px;
}

.nav-mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg);
}

.nav-mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg);
}

/* Mobile Menu Overlay */
.nav-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.nav-mobile-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Mobile Menu Panel */
.nav-mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: var(--bg-elevated, #FFFFFF);
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 80px 0 0 0;
}

/* Mobile Menu Close Button */
.nav-mobile-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.nav-mobile-close:hover {
    background: var(--neutral-100, #F5F4F0);
}

.nav-mobile-close span {
    position: absolute;
    width: 20px;
    height: 2px;
    background: var(--neutral-700, #4A4A45);
    border-radius: 1px;
    transition: all 0.3s ease;
}

.nav-mobile-close span:nth-child(1) {
    transform: rotate(45deg);
}

.nav-mobile-close span:nth-child(2) {
    transform: rotate(-45deg);
}

.nav-mobile-menu.show {
    transform: translateX(0);
}

/* Mobile Menu Content */
.nav-mobile-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Mobile Menu CTA Section */
.nav-mobile-cta-section {
    /* Use a fixed margin to create space after the last link */
    margin-top: 32px; 
    padding: 24px;
    
    background: var(--bg-elevated, #FFFFFF);
    /* Add basic breathing room at the bottom */
    padding-bottom: 32px !important;
    
    /* specific fix for iOS and devices with bottom safe areas/home bars */
    padding-bottom: calc(28px + env(safe-area-inset-bottom)) !important; 
}

.nav-mobile-item {
    border-bottom: 1px solid var(--neutral-200, #E8E6E0);
}

.nav-mobile-link {
    display: block;
    padding: 16px 24px;
    color: var(--neutral-700, #4A4A45);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-mobile-link:hover {
    background: var(--primary-50, #FFF5F7);
    color: var(--primary-600, #B86D83);
}

.nav-mobile-link.active {
    background: var(--primary-50, #FFF5F7);
    color: var(--primary-600, #B86D83);
    border-right: 4px solid var(--primary-500, #D4849C);
}

.nav-mobile-cta {
    display: block;
    background: var(--primary-500, #D4849C);
    color: white;
    padding: 16px 24px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    border-radius: var(--radius-md, 15px);
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}

.nav-mobile-cta:hover {
    background: var(--primary-600, #B86D83);
    transform: translateY(-2px);
}

/* Mobile User Section */
.nav-mobile-user {
    padding: 20px 24px;
    background: var(--primary-50, #FFF5F7);
    margin: 16px 24px;
    border-radius: var(--radius-md, 15px);
    display: none;
}

.nav-mobile-user.show {
    display: block;
}

.nav-mobile-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.nav-mobile-user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-500, #D4849C);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.nav-mobile-user-name {
    font-weight: 600;
    color: var(--primary-600, #B86D83);
}

.nav-mobile-user-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-mobile-user-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--neutral-700, #4A4A45);
    text-decoration: none;
    text-align: left;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 14px;
}

.nav-mobile-user-btn:hover {
    background: white;
    color: var(--primary-600, #B86D83);
}

/* Mobile Authentication */
.nav-mobile-auth {
    padding: 20px 24px;
    border-bottom: 1px solid var(--neutral-200, #E8E6E0);
}

.nav-mobile-signin {
    display: block;
    padding: 12px 0;
    color: var(--neutral-700, #4A4A45);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-mobile-signin:hover {
    color: var(--primary-600, #B86D83);
}

/* Responsive Behavior */
@media (max-width: 768px) {
    /* Hide desktop menu on mobile */
    .nav-menu {
        display: none !important;
    }
    
    .desktop-menu {
        display: none !important;
    }
    
    /* Show mobile toggle */
    .nav-mobile-toggle {
        display: flex;
    }
    
    /* Prevent body scroll when menu is open */
    body.mobile-menu-open {
        overflow: hidden;
    }
}

/* Utility classes for different page structures */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.space-x-8 > * + * { margin-left: 2rem; }
.h-20 { height: 5rem; }