/* =====================================================
   COMMUNITY COMPONENTS - Component-specific Styles
   Source: communitiesdesign/incontrol-community-li.html
   WCAG 2.1 AA Compliant
   ===================================================== */

/* =====================================================
   HEADER COMPONENTS
u   Copied exactly from reference: incontrol-community-li.html
   ===================================================== */

.header {
    background: var(--bg-white);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
}

/* Main navigation - hidden on mobile by default */
.nav {
    display: none;
    gap: 2rem;
    align-items: center;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    min-height: 64px;
    background: none;
    border: none;
    color: inherit;
    text-decoration: none;
    font-family: inherit;
}

.nav-item:hover {
    background: var(--glass-white);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: var(--primary-color);
}

.nav-icon {
    font-size: var(--font-size-xl);
    color: var(--primary-color);
}

.nav-label {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.nav-profile-photo {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

/* Profile photo fallback with initials */
.nav-profile-initials {
    background: var(--primary-color);
    color: var(--primary-color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.625rem;
}

.nav-item-me {
    flex-direction: column;
}

.nav-item-me .nav-label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-item-me .nav-label i {
    font-size: 0.5rem;
}

/* Notification badge for "Me" nav item (desktop only) */
.nav-item-me {
    position: relative;
}

.me-notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    /* WCAG AA compliant gradient with white text */
    background: linear-gradient(135deg, var(--notification-gradient-start) 0%, var(--notification-gradient-end) 100%);
    color: white;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    font-size: 0.625rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(196, 77, 28, 0.4);
    animation: pulse-notification 2s ease-in-out infinite;
}

@keyframes pulse-notification {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(196, 77, 28, 0.4);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 4px 12px rgba(196, 77, 28, 0.6);
    }
}

/* Disable animation if user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    .me-notification-badge {
        animation: none;
    }
}

/* Mobile community name - shown on mobile, hidden on desktop */
.mobile-community-name {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
    text-align: left;
}

/* Desktop community logo container */
.desktop-logo-container {
    display: none; /* Hidden on mobile by default */
    background: var(--bg-white);
    padding: 0.25rem 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid var(--glass-border);
    height: 75px;
    align-items: center;
}

.desktop-logo-container img {
    height: 100%;
    width: auto;
    object-fit: contain;
}

/* Focus styles for logo link (WCAG 2.1 AA) */
a.desktop-logo-container:focus {
    outline: 2px solid var(--community-primary);
    outline-offset: 2px;
}

a.desktop-logo-container:hover {
    opacity: 0.9;
}

/* Left content wrapper to group logo and filter tabs */
.header-left-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Filter tabs in header */
.filter-tabs {
    display: none; /* Hidden on mobile by default */
    gap: 1rem;
    background: var(--bg-white);
    padding: 0.25rem;
    border-radius: 0.75rem;
    border: 1px solid var(--glass-border);
    position: relative;
}

/* Scroll indicators for filter tabs */
.filter-tabs::before,
.filter-tabs::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1;
}

.filter-tabs::before {
    left: 0;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.95), transparent);
}

.filter-tabs::after {
    right: 0;
    background: linear-gradient(to left, rgba(255, 255, 255, 0.95), transparent);
}

.filter-tabs.show-left-shadow::before {
    opacity: 1;
}

.filter-tabs.show-right-shadow::after {
    opacity: 1;
}

.filter-tab {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    font-size: var(--font-size-sm);
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.filter-tab:hover {
    background: rgba(106, 74, 158, 0.08);
    color: var(--text-primary);
    text-decoration: none;
}

.filter-tab.active {
    background: var(--primary-color);
    color: var(--primary-color-text);
    text-decoration: none;
}

.filter-tab:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    text-decoration: none;
}

/* =====================================================
   HEADER RESPONSIVE - Tablets (768px+)
   ===================================================== */
@media (min-width: 768px) {
    /* Show filter tabs on tablets and above */
    .filter-tabs {
        display: flex;
        overflow-x: visible;
        flex-wrap: wrap;
    }

    /* Hide mobile community name on tablets and above */
    .mobile-community-name {
        display: none;
    }

    /* Restore space-between layout for tablets */
    .header-content {
        justify-content: space-between;
        padding: 0 2rem;
        gap: 2rem;
    }
}

/* =====================================================
   HEADER RESPONSIVE - Desktop (1250px+)
   ===================================================== */
@media (min-width: 1250px) {
    .nav {
        display: flex;
    }

    .desktop-logo-container {
        display: flex;
    }

    /* Adjust header layout for logo + filter tabs */
    .header-content {
        gap: 1.5rem;
    }

    /* Reduce header padding on desktop for compact navbar with large logo */
    .header {
        padding: 0.5rem 0;
    }
}

