/* ===================================
   Universal Header Styles
   =================================== */

.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 2rem;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--foreground);
}

.logo-text .gradient-text {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
}

.nav-link {
    position: relative;
    padding: 0.75rem 1.25rem;
    color: var(--foreground);
    font-weight: 500;
    font-size: 0.938rem;
    text-decoration: none;
    transition: color 0.2s ease;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link.active {
    color: var(--primary);
    font-weight: 600;
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.dropdown-arrow {
    transition: transform 0.2s ease;
}

.nav-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 1.5rem;
    min-width: 600px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    transform: translateX(-50%) translateY(-10px);
    pointer-events: none;
}

.nav-dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.dropdown-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-height: 450px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Scrollbar styling for dropdown */
.dropdown-grid::-webkit-scrollbar {
    width: 6px;
}

.dropdown-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.dropdown-grid::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.dropdown-grid::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    border-radius: 0.75rem;
    text-decoration: none;
    transition: background 0.2s ease;
}

.dropdown-item:hover {
    background: var(--accent);
}

.dropdown-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.dropdown-item-content {
    flex: 1;
    min-width: 0;
}

.dropdown-item-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--foreground);
    margin-bottom: 0.125rem;
}

.dropdown-item-description {
    font-size: 0.688rem;
    color: var(--muted-foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.view-all-link {
    display: block;
    text-align: center;
    padding: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.938rem;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: background 0.2s ease;
}

.view-all-link:hover {
    background: var(--accent);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    color: var(--foreground);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.search-toggle:hover {
    background: var(--accent);
    color: var(--primary);
}

.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    color: var(--foreground);
    cursor: pointer;
    transition: background 0.2s ease;
}

.mobile-menu-toggle:hover {
    background: var(--accent);
}

/* Mobile Styles */
@media (max-width: 1024px) {
    .dropdown-menu {
        min-width: 500px;
    }

    .dropdown-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 0.75rem 0;
    }

    .nav-menu {
        position: fixed;
        top: 73px;
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: column;
        align-items: stretch;
        background: white;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        padding: 1rem;
        gap: 0.5rem;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-link {
        padding: 1rem;
        border-bottom: 1px solid var(--border);
    }

    .nav-dropdown {
        width: 100%;
    }

    .dropdown-menu {
        position: static;
        transform: none;
        min-width: 100%;
        margin-top: 0.5rem;
        box-shadow: none;
        border: 1px solid var(--border);
        padding: 1rem;
    }

    .dropdown-grid {
        grid-template-columns: 1fr;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .search-toggle {
        display: none;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 1.25rem;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }
}