/* =====================================================
   LOADING AND SKELETON COMPONENTS
   WCAG 2.1 AA Compliant
   ===================================================== */

/* =====================================================
   FEED SKELETON LOADER
   Placeholder cards that mimic feed items during loading
   WCAG 2.1 AA Compliant - respects prefers-reduced-motion
   ===================================================== */

.feed-skeleton {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.skeleton-post {
    background: var(--bg-white);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0px 4px 20px 0px rgba(209, 209, 209, 0.15);
}

.skeleton-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    flex-shrink: 0;
}

.skeleton-author-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.skeleton-line {
    height: 0.875rem;
    border-radius: 0.25rem;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 60%; }
.skeleton-line.long { width: 80%; }
.skeleton-line.full { width: 100%; }

.skeleton-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.skeleton-title {
    height: 1.25rem;
    width: 70%;
    margin-bottom: var(--spacing-xs);
}

.skeleton-actions {
    display: flex;
    gap: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--glass-border);
}

.skeleton-button {
    width: 80px;
    height: 2rem;
    border-radius: 0.5rem;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Staggered animation for visual interest */
.skeleton-post:nth-child(2) .skeleton-avatar,
.skeleton-post:nth-child(2) .skeleton-line {
    animation-delay: 0.15s;
}

.skeleton-post:nth-child(3) .skeleton-avatar,
.skeleton-post:nth-child(3) .skeleton-line {
    animation-delay: 0.3s;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .skeleton-avatar,
    .skeleton-line {
        animation: none;
        background: #f0f0f0;
    }
}

/* =====================================================
   COMMUNITY LAYOUT SKELETON
   Skeleton loader for initial community load
   ===================================================== */

.community-layout-skeleton {
    min-height: 100vh;
    background: var(--bg-gray-light, #f9fafb);
}

/* Minimal Header Bar Skeleton */
.skeleton-header-bar {
    background: var(--bg-white, #ffffff);
    border-bottom: 1px solid var(--glass-border, rgba(0, 0, 0, 0.1));
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
}

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

.skeleton-logo {
    width: 120px;
    height: 40px;
    border-radius: 0.5rem;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-header-right {
    display: flex;
    gap: 1rem;
}

.skeleton-nav-item {
    width: 80px;
    height: 32px;
    border-radius: 0.5rem;
}

/* Skeleton Main Container - matches real layout */
.skeleton-main {
    padding-top: 80px; /* Account for fixed header */
}

/* Sidebar Skeleton Cards */
.skeleton-sidebar {
    display: none;
}

.skeleton-sidebar-card {
    background: var(--bg-white, #ffffff);
    border: 1px solid var(--glass-border, rgba(0, 0, 0, 0.1));
    border-radius: 1rem;
    overflow: hidden;
}

/* Profile Card Skeleton */
.skeleton-profile-card {
    padding-bottom: 1rem;
}

.skeleton-card-header {
    height: 80px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-card-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    margin: -32px auto 0;
    border: 3px solid var(--bg-white, #ffffff);
}

.skeleton-card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.skeleton-card-stats {
    display: flex;
    gap: 2rem;
    margin-top: 0.5rem;
}

.skeleton-stat {
    width: 60px;
    height: 40px;
    border-radius: 0.5rem;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
}

/* Events Card Skeleton */
.skeleton-events-card {
    padding: 1rem;
}

.skeleton-card-title {
    width: 60%;
    height: 1.25rem;
    border-radius: 0.25rem;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    margin-bottom: 1rem;
}

.skeleton-event-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--glass-border, rgba(0, 0, 0, 0.1));
}

.skeleton-event-item:last-child {
    border-bottom: none;
}

.skeleton-event-date {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    flex-shrink: 0;
}

.skeleton-event-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: center;
}

/* Staggered animations for layout skeleton */
.skeleton-sidebar-card:nth-child(2) .skeleton-line,
.skeleton-sidebar-card:nth-child(2) .skeleton-stat,
.skeleton-sidebar-card:nth-child(2) .skeleton-event-date {
    animation-delay: 0.2s;
}

/* Desktop: Show sidebars */
@media (min-width: 1250px) {
    .skeleton-sidebar {
        display: block;
    }

    .skeleton-header-content {
        padding: 0 2rem;
    }
}

/* Reduced motion for layout skeleton */
@media (prefers-reduced-motion: reduce) {
    .skeleton-logo,
    .skeleton-card-header,
    .skeleton-card-avatar,
    .skeleton-stat,
    .skeleton-card-title,
    .skeleton-event-date {
        animation: none;
        background: #f0f0f0;
    }
}

/* =====================================================
   COMMUNITY LOGIN ROUTER
   Full-screen sign-in prompt for restricted communities
   WCAG 2.1 AA Compliant
   ===================================================== */

.login-router-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--community-primary, #6A4A9E) 0%, var(--community-accent, #7BCED7) 100%);
    padding: 2rem;
}

.login-router-container {
    position: relative;
    background: var(--bg-white, #ffffff);
    border-radius: 1.5rem;
    box-shadow: 0 16px 56px rgba(0, 0, 0, 0.25);
    width: 75vw;
    max-width: 1200px;
    padding: 3rem 2.5rem;
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
}

.login-router-header {
    margin-bottom: 2rem;
}

.login-router-logo {
    max-width: 160px;
    max-height: 80px;
    object-fit: contain;
}

.login-router-content {
    margin-bottom: 2rem;
}

.login-router-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary, #1f2937);
    margin: 0 0 0.75rem 0;
    line-height: 1.3;
}

.login-router-tagline {
    font-size: 1rem;
    color: var(--text-secondary, #4B5563);
    margin: 0 0 1rem 0;
    line-height: 1.5;
    font-style: italic;
}

.login-router-description {
    font-size: 0.875rem;
    color: var(--text-primary, #1f2937);
    margin: 0 0 1.5rem 0;
    line-height: 1.7;
}

.login-router-message {
    background: rgba(106, 74, 158, 0.08);
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    text-align: left;
}

.login-router-message i {
    font-size: 1.25rem;
    color: var(--community-primary, #6A4A9E);
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.login-router-message p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-primary, #1f2937);
    line-height: 1.6;
}

.login-router-actions {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    justify-content: center;
}

.login-router-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 48px;
    border: none;
    font-family: inherit;
}

.login-router-btn-primary {
    background: var(--community-primary, #6A4A9E);
    color: var(--community-primary-text, #ffffff);
}

.login-router-btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.login-router-btn-secondary {
    background: transparent;
    color: var(--text-secondary, #4B5563);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.login-router-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-primary, #1f2937);
}

.login-router-btn:focus-visible {
    outline: 3px solid var(--community-primary, #6A4A9E);
    outline-offset: 2px;
}

