/**
 * Navigation Component CSS
 */

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Hide icons on desktop */
.nav-link i {
    display: none;
}

.nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.nav-link.active {
    background: #667eea;
    color: white;
}

/* Mobile Navigation Buttons Container */
.mobile-nav-buttons {
    display: none;
    align-items: center;
    gap: 0.75rem;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #4a5568;
    cursor: pointer;
}

.mobile-confess-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #4a5568;
    cursor: pointer;
    text-decoration: none;
}

/* Tablet Navigation */
@media (max-width: 1024px) {
    .nav-menu {
        gap: 1.5rem;
    }
    
    .nav-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.95rem;
    }
}

/* Mobile Navigation */
@media (max-width: 768px) {
    /* Ensure header has fixed positioning for mobile */
    .header {
        position: fixed;
        z-index: 1001;
    }
    
    /* Add padding to body to account for fixed header */
    body {
        padding-top: var(--header-height, 72px);
    }
    
    .nav-menu {
        display: none;
        position: fixed;
        top: calc(var(--header-height, 72px));
        left: 0;
        right: 0;
        width: 100vw;
        background: 
            linear-gradient(135deg, 
                rgba(102, 126, 234, 0.95) 0%, 
                rgba(118, 75, 162, 0.95) 50%, 
                rgba(83, 109, 254, 0.95) 100%
            );
        backdrop-filter: blur(25px);
        flex-direction: column;
        padding: 1.5rem 1.25rem 2rem;
        box-shadow: 
            0 20px 60px rgba(102, 126, 234, 0.3),
            0 8px 32px rgba(118, 75, 162, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
        gap: 0;
        border-radius: 0 0 28px 28px;
        max-height: calc(100vh - var(--header-height, 72px) - 2px);
        overflow-y: auto;
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-top: none;
        z-index: 1000;
        /* Safari mobile fixes */
        -webkit-overflow-scrolling: touch;
        transform: translateZ(0);
    }
    
    /* iPhone Safari specific fixes */
    @supports (-webkit-touch-callout: none) {
        .nav-menu {
            position: fixed;
            top: var(--header-height, 72px);
        }
        
        .header {
            position: fixed;
            top: 0;
            transform: translateZ(0);
        }
    }
    
    .nav-menu::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
        opacity: 0.1;
        border-radius: 0 0 26px 26px;
        pointer-events: none;
    }
    
    .nav-menu.active {
        display: flex;
        animation: slideDown 0.4s ease-out;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-15px) scale(0.98);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
    
    /* Avatar section - elegant presentation */
    .nav-avatar {
        order: -2;
        margin: 0 0 1.5rem 0;
        padding: 0 0 1.25rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        align-self: center;
        position: relative;
    }
    
    /* Larger avatar in mobile menu */
    .nav-menu .avatar-link {
        padding: 8px;
        margin: -8px;
        border-radius: 50%;
        min-height: 60px;
        min-width: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-menu .header-avatar-img {
        width: 48px;
        height: 48px;
        border: 3px solid rgba(255, 255, 255, 0.4);
    }
    
    .nav-menu .header-avatar-symbol {
        width: 48px;
        height: 48px;
        font-size: 1.4rem;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
        border: 3px solid rgba(255, 255, 255, 0.4);
    }
    
    .nav-menu .avatar-link:hover .header-avatar-img {
        border-color: rgba(255, 255, 255, 0.7);
    }
    
    .nav-menu .avatar-link:hover .header-avatar-symbol {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
        border-color: rgba(255, 255, 255, 0.7);
    }
    
    .nav-avatar::after {
        content: '';
        position: absolute;
        bottom: -1px;
        left: 50%;
        transform: translateX(-50%);
        width: 60px;
        height: 2px;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
        border-radius: 2px;
    }
    
    /* Start Confession Button Section */
    .nav-menu li:has(.btn) {
        order: -1;
        margin: 0 0 1.75rem 0;
        padding: 0 0 1.25rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        position: relative;
    }
    
    .nav-menu li:has(.btn)::after {
        content: '';
        position: absolute;
        bottom: -1px;
        left: 50%;
        transform: translateX(-50%);
        width: 80px;
        height: 2px;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
        border-radius: 2px;
    }
    
    .nav-menu .btn {
        width: 100%;
        padding: 1.25rem 2rem;
        font-size: 1.1rem;
        font-weight: 700;
        border-radius: 20px;
        background: 
            linear-gradient(135deg, 
                rgba(255, 255, 255, 1) 0%,
                rgba(248, 250, 252, 0.98) 100%
            );
        color: #667eea;
        box-shadow: 
            0 12px 40px rgba(0, 0, 0, 0.15),
            0 6px 20px rgba(102, 126, 234, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.8),
            inset 0 -1px 0 rgba(0, 0, 0, 0.05);
        border: 2px solid rgba(255, 255, 255, 0.8);
        text-decoration: none;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        text-transform: none;
        min-height: 58px;
        position: relative;
        overflow: hidden;
        backdrop-filter: blur(10px);
    }
    
    .nav-menu .btn::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.6s ease;
    }
    
    .nav-menu .btn:hover::before {
        left: 100%;
    }
    
    .nav-menu .btn:hover {
        transform: translateY(-4px) scale(1.03);
        box-shadow: 
            0 16px 50px rgba(0, 0, 0, 0.2),
            0 8px 25px rgba(102, 126, 234, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
        color: #5a67d8;
        border-color: rgba(255, 255, 255, 0.9);
    }
    
    .nav-menu .btn i {
        font-size: 1.25rem;
        filter: drop-shadow(0 1px 3px rgba(102, 126, 234, 0.3));
    }
    
    /* Navigation Links Section */
    .nav-menu li:not(:has(.btn)):not(.nav-avatar) {
        margin-bottom: 0.5rem;
        animation: fadeInUp 0.3s ease-out;
        animation-fill-mode: both;
    }
    
    .nav-menu li:not(:has(.btn)):not(.nav-avatar):nth-child(3) { animation-delay: 0.1s; }
    .nav-menu li:not(:has(.btn)):not(.nav-avatar):nth-child(4) { animation-delay: 0.2s; }
    .nav-menu li:not(:has(.btn)):not(.nav-avatar):nth-child(5) { animation-delay: 0.3s; }
    .nav-menu li:not(:has(.btn)):not(.nav-avatar):nth-child(6) { animation-delay: 0.4s; }
    
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Show icons in mobile menu */
    .nav-menu .nav-link i {
        display: inline-block;
        font-size: 1.1rem;
        opacity: 0.9;
    }
    
    /* Regular nav links */
    .nav-link:not(.btn) {
        padding: 0.875rem 1.5rem;
        border-radius: 16px;
        text-align: center;
        font-size: 1.0rem;
        font-weight: 600;
        min-height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.625rem;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        background: rgba(255, 255, 255, 0.25);
        border: 1.5px solid rgba(255, 255, 255, 0.3);
        color: rgba(255, 255, 255, 0.9);
        position: relative;
        overflow: hidden;
        backdrop-filter: blur(10px);
    }
    
    .nav-link:not(.btn)::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
        transition: left 0.5s ease;
    }
    
    .nav-link:not(.btn):hover::before {
        left: 100%;
    }
    
    .nav-link:not(.btn):hover {
        background: rgba(255, 255, 255, 0.35);
        border-color: rgba(255, 255, 255, 0.5);
        transform: translateX(4px) scale(1.02);
        color: rgba(255, 255, 255, 1);
        box-shadow: 
            0 6px 20px rgba(0, 0, 0, 0.1),
            0 3px 10px rgba(255, 255, 255, 0.1);
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }
    
    .nav-link:not(.btn).active {
        background: rgba(255, 255, 255, 0.4);
        color: rgba(255, 255, 255, 1);
        font-weight: 700;
        border-color: rgba(255, 255, 255, 0.6);
        box-shadow: 
            0 8px 25px rgba(0, 0, 0, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
        transform: scale(1.02);
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }
    
    /* Mobile navigation buttons */
    .mobile-nav-buttons {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    /* Mobile confession button */
    .mobile-confess-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 10px;
        border-radius: 12px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        min-height: 48px;
        min-width: 48px;
        background: linear-gradient(135deg, #667eea, #764ba2);
        border: 1px solid rgba(255, 255, 255, 0.3);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
        color: white;
        font-size: 1.1rem;
        text-decoration: none;
    }
    
    .mobile-confess-btn:hover {
        background: linear-gradient(135deg, #5a67d8, #6b46c1);
        box-shadow: 0 6px 16px rgba(102, 126, 234, 0.35);
        transform: translateY(-1px) scale(1.02);
        border-color: rgba(255, 255, 255, 0.4);
    }
    
    /* Mobile avatar button */
    .mobile-avatar-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 4px;
        border-radius: 50%;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        min-height: 48px;
        min-width: 48px;
        background: rgba(255, 255, 255, 0.9);
        border: 2px solid rgba(102, 126, 234, 0.3);
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
        text-decoration: none;
    }
    
    .mobile-avatar-btn:hover {
        border-color: rgba(102, 126, 234, 0.5);
        box-shadow: 0 5px 15px rgba(102, 126, 234, 0.15);
        transform: scale(1.05);
        background: rgba(255, 255, 255, 1);
    }
    
    .mobile-avatar-img {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        object-fit: cover;
    }
    
    .mobile-avatar-symbol {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    }
    
    /* Mobile menu button improvements */
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 10px;
        border-radius: 12px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        min-height: 48px;
        min-width: 48px;
        position: relative;
        background: rgba(255, 255, 255, 0.8);
        border: 1px solid rgba(226, 232, 240, 0.6);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        font-size: 1.1rem;
    }
    
    .mobile-menu-btn:hover {
        background: rgba(102, 126, 234, 0.08);
        border-color: rgba(102, 126, 234, 0.3);
        color: #667eea;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
        transform: scale(1.02);
    }
    
    .mobile-menu-btn.active {
        background: rgba(102, 126, 234, 0.12);
        border-color: rgba(102, 126, 234, 0.4);
        color: #667eea;
        box-shadow: 0 6px 16px rgba(102, 126, 234, 0.2);
        transform: scale(1.02);
    }
    
    .mobile-menu-btn.active i {
        transform: rotate(90deg);
    }
    
    /* Last item styling */
    .nav-menu li:last-of-type:not(:has(.btn)):not(.nav-avatar) {
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    .nav-menu {
        padding: 1.75rem 1rem 1.5rem;
        border-radius: 0 0 20px 20px;
    }
    
    /* Mobile confession button on small screens */
    .nav-menu .btn {
        padding: 1.25rem 1.5rem;
        font-size: 1.05rem;
        min-height: 56px;
        gap: 0.75rem;
        border-radius: 16px;
    }
    
    .nav-menu .btn i {
        font-size: 1.2rem;
    }
    
    /* Regular nav links on small screens */
    .nav-link:not(.btn) {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-height: 50px;
        border-radius: 12px;
    }
    
    /* Mobile navigation buttons for small screens */
    .mobile-nav-buttons {
        gap: 0.4rem;
    }
    
    .mobile-confess-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 8px;
        font-size: 1rem;
        border-radius: 10px;
    }
    
    .mobile-avatar-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 3px;
    }
    
    .mobile-avatar-img {
        width: 32px;
        height: 32px;
    }
    
    .mobile-avatar-symbol {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }
    
    .mobile-menu-btn {
        font-size: 1rem;
        min-height: 44px;
        min-width: 44px;
        padding: 8px;
        border-radius: 10px;
    }
    
    /* Spacing adjustments for small screens */
    .nav-avatar {
        margin-bottom: 1.5rem;
        padding-bottom: 1.25rem;
    }
    
    .nav-menu li:has(.btn) {
        margin-bottom: 1.5rem;
        padding-bottom: 1.25rem;
    }
    
    .nav-menu li:not(:has(.btn)):not(.nav-avatar) {
        margin-bottom: 0.4rem;
    }
    
    /* Decorative elements scale down */
    .nav-avatar::after {
        width: 50px;
        height: 1.5px;
    }
    
    .nav-menu li:has(.btn)::after {
        width: 70px;
        height: 1.5px;
    }
}