/* Layout Components */

/* Header */
.header {
    background: #ffffff;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid #f3f4f6;
    transition: box-shadow 0.3s ease;
}

.header.scrolled {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    height: 72px;
}

/* Footer */
.footer {
    background: #111827;
    color: #ffffff;
    padding: 4rem 2rem 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 4rem;
    margin-bottom: 4rem;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Mobile Controls */
.mobile-controls {
    display: none;
    align-items: center;
    gap: 0.75rem;
}

@media (max-width: 992px) {
    .mobile-controls {
        display: flex;
    }

    .nav-menu,
    .nav-actions {
        display: none !important;
    }
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s ease;
    color: #6b7280;
}

.mobile-menu-btn:hover {
    background: #f3f4f6;
}

.mobile-menu-btn svg {
    width: 24px;
    height: 24px;
}

/* Mobile Menu Overlay */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
    display: none;
    /* Hidden by default on desktop */
}

@media (max-width: 992px) {
    .mobile-menu {
        display: block;
    }
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Mobile Menu Content */
.mobile-menu-content {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100%;
    background: white;
    z-index: 2001;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

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

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.mobile-menu-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
}

.mobile-menu-logo-icon {
    width: 40px;
    height: 40px;
    background: #3b82f6;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
}

.mobile-menu-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    color: #6b7280;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.mobile-menu-close svg {
    width: 24px;
    height: 24px;
}

/* Mobile User Profile */
.mobile-user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.mobile-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.mobile-user-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.mobile-user-info p {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.mobile-nav-links {
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.mobile-nav-link svg {
    flex-shrink: 0;
}

.mobile-nav-link:hover {
    background: #f9fafb;
    color: #1f2937;
}

.mobile-auth-container {
    padding: 1.5rem;
    border-top: 1px solid #f3f4f6;
}

.mobile-auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mobile-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.mobile-auth-btn.primary {
    background: #3b82f6;
    color: white;
}

.mobile-auth-btn.secondary {
    background: #f3f4f6;
    color: #1f2937;
}

.mobile-logout-btn {
    width: calc(100% - 3rem);
    margin: 1.5rem;
    padding: 0.75rem;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fee2e2;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.mobile-logout-btn svg {
    flex-shrink: 0;
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 0.5rem;
}
/* Avatar Dropdown Styles */
.avatar-dropdown {
    position: fixed;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    min-width: 280px;
    max-width: 320px;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.avatar-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Dropdown Header */
.avatar-dropdown-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-bottom: 1px solid #f3f4f6;
}

.avatar-dropdown-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    flex-shrink: 0;
    border: 3px solid #ffffff;
}

.avatar-dropdown-info {
    flex: 1;
    min-width: 0;
}

.avatar-dropdown-info h4 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.25rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.avatar-dropdown-info p {
    font-size: 0.8125rem;
    color: #6b7280;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dropdown Menu */
.avatar-dropdown-menu {
    padding: 0.5rem;
    background: #ffffff;
}

.avatar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    color: #4b5563;
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.avatar-dropdown-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.04) 100%);
    transition: width 0.3s ease;
    z-index: -1;
}

.avatar-dropdown-item:hover::before {
    width: 100%;
}

.avatar-dropdown-item:hover {
    background: #f9fafb;
    color: #1f2937;
    transform: translateX(4px);
}

.avatar-dropdown-item:active {
    transform: translateX(2px) scale(0.98);
}

.avatar-dropdown-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke-width: 2;
    transition: all 0.2s ease;
}

.avatar-dropdown-item:hover svg {
    color: #3b82f6;
    transform: scale(1.1);
}

/* Special styling for logout button */
.avatar-dropdown-item:last-child {
    color: #dc2626;
}

.avatar-dropdown-item:last-child:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.avatar-dropdown-item:last-child svg {
    color: #dc2626;
}

.avatar-dropdown-item:last-child:hover svg {
    color: #b91c1c;
}

/* Dropdown Divider */
.avatar-dropdown-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #e5e7eb 50%, transparent 100%);
    margin: 0.5rem 0;
}

/* Add subtle animation on dropdown items */
.avatar-dropdown-item {
    animation: fadeInItem 0.3s ease backwards;
}

.avatar-dropdown-item:nth-child(1) { animation-delay: 0.05s; }
.avatar-dropdown-item:nth-child(2) { animation-delay: 0.1s; }
.avatar-dropdown-item:nth-child(3) { animation-delay: 0.15s; }
.avatar-dropdown-item:nth-child(4) { animation-delay: 0.2s; }
.avatar-dropdown-item:nth-child(5) { animation-delay: 0.25s; }

@keyframes fadeInItem {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .avatar-dropdown {
        min-width: 260px;
        max-width: 90vw;
    }
    
    .avatar-dropdown-header {
        padding: 1rem 1.25rem;
    }
    
    .avatar-dropdown-avatar {
        width: 48px;
        height: 48px;
        font-size: 1rem;
    }
}

/* Add a subtle glow effect when dropdown is active */
.avatar-dropdown.active {
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 1px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(59, 130, 246, 0.1);
}

/* User Avatar Button Enhancements */
.user-avatar-container {
    position: relative;
}

.user-avatar-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
    overflow: hidden;
}

.user-avatar-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.user-avatar-btn:hover::before {
    opacity: 1;
}

.user-avatar-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.user-avatar-btn:active {
    transform: translateY(0) scale(1);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.user-avatar-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Add a subtle pulse animation when dropdown is open */
.user-avatar-btn.active {
    animation: avatarPulse 2s ease-in-out infinite;
}

@keyframes avatarPulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
    }
    50% {
        box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
    }
}
