/* ==============================================
   CONNECT (SOCIAL) PAGE -- Claude Design reskin
   Ported from the "unQbd Connect social feed" design. Self-contained:
   every class here is Connect-only (SocialFeed is used only by the
   Connect page). The post CARD internals are NOT here -- they live in
   the shared SocialPostCard / user-profile.css and are left untouched;
   this file styles only the page chrome, feed wrapper, and feed states.
   --soc-* tokens resolve from brand-tokens.css with safe fallbacks.
   Dark mode is handled via body.dark-mode (never prefers-color-scheme).
   ============================================== */

@keyframes social-spin { to { transform: rotate(360deg); } }
@keyframes social-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ==============================================
   TOKEN LAYER
   ============================================== */

.page-social {
    --soc-primary: var(--brand-primary, #00B4FF);
    --soc-primary-deep: var(--brand-secondary, #0174B1);
    --soc-primary-light: var(--brand-primary-light, #4DB8FF);
    --soc-cta: var(--brand-cta, #FFAA00);
    --soc-success: #17B26A;

    --soc-bg: #F6FBFF;
    --soc-surface: #FFFFFF;
    --soc-surface-alt: #F8FAFC;
    --soc-navbg: rgba(255, 255, 255, 0.88);
    --soc-ink: var(--brand-charcoal, #222222);
    --soc-ink-2: #475569;
    --soc-ink-3: #64748B;
    --soc-border: var(--brand-divider, #E0E0E0);
    --soc-border-subtle: rgba(2, 6, 23, 0.06);

    --soc-r-sm: 8px;
    --soc-r-md: 10px;
    --soc-r-lg: 14px;
    --soc-r-xl: 20px;
    --soc-r-pill: 999px;
    --soc-shadow-xs: 0 1px 2px rgba(2, 6, 23, 0.05);
    --soc-shadow-sm: 0 2px 8px rgba(2, 6, 23, 0.06);
    --soc-shadow-md: 0 8px 24px rgba(2, 6, 23, 0.08);
    --soc-shadow-blue: 0 10px 28px rgba(0, 180, 255, 0.28);
    --soc-ease: cubic-bezier(0.22, 1, 0.36, 1);

    min-height: 100vh;
    min-height: 100dvh;
    background: var(--soc-bg);
    color: var(--soc-ink);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.page-social *,
.page-social *::before,
.page-social *::after { box-sizing: border-box; }

body.dark-mode .page-social {
    --soc-bg: #0B1118;
    --soc-surface: #161E29;
    --soc-surface-alt: #1E2937;
    --soc-navbg: rgba(11, 17, 24, 0.88);
    --soc-ink: #EAF0F6;
    --soc-ink-2: #B7C3D1;
    --soc-ink-3: #8493A6;
    --soc-border: rgba(255, 255, 255, 0.09);
    --soc-border-subtle: rgba(255, 255, 255, 0.06);
    --soc-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
    --soc-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --soc-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.social-content {
    width: 100%;
    margin: 0;
    overflow-x: hidden;
}

/* ==============================================
   FULL-PAGE LOADING STATE
   (rendered outside .page-social, so it uses brand values directly)
   ============================================== */

.social-loading {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 7rem 2rem 3rem 2rem;
    background: #F6FBFF;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body.dark-mode .social-loading { background: #0B1118; }

.social-loading-spinner {
    width: 46px;
    height: 46px;
    margin-bottom: 1.25rem;
    border: 3px solid #E5EAF0;
    border-top-color: var(--brand-primary, #00B4FF);
    border-radius: 50%;
    animation: social-spin 0.8s linear infinite;
}

body.dark-mode .social-loading-spinner {
    border-color: #253347;
    border-top-color: var(--brand-primary-light, #4DB8FF);
}

.social-loading-text {
    margin: 0;
    color: #64748B;
    font-size: 0.95rem;
    font-weight: 500;
}

body.dark-mode .social-loading-text { color: #8493A6; }

/* ==============================================
   HEADER (HERO)
   ============================================== */

.social-header-section {
    width: 100%;
    margin: 0;
    padding: 7.5rem 0 2.5rem 0;
    background: radial-gradient(120% 90% at 50% 0%, rgba(0, 180, 255, 0.12) 0%, transparent 60%);
    border-bottom: 1px solid var(--soc-border);
}

.social-header-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.social-header-content {
    text-align: center;
}

/* Stack the icon above the title (centered), with the subtitle below. */
.social-title-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-bottom: 0.75rem;
}

.social-icon {
    width: 72px;
    height: 72px;
    margin-bottom: 18px;
    background: linear-gradient(135deg, var(--soc-primary) 0%, var(--soc-primary-deep) 100%);
    border-radius: var(--soc-r-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 2rem;
    box-shadow: var(--soc-shadow-blue);
}

.social-title {
    font-size: clamp(2rem, 6vw, 2.75rem);
    font-weight: 800;
    color: var(--soc-ink);
    margin: 0;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

.social-subtitle {
    font-size: clamp(0.95rem, 2.2vw, 1.0625rem);
    color: var(--soc-ink-2);
    margin: 0.5rem auto 0;
    max-width: 460px;
    line-height: 1.5;
}

/* ==============================================
   STICKY CONTROLS (TABS)
   ============================================== */

.social-controls-section {
    padding: 0.75rem 0;
    position: sticky;
    top: 70px;
    z-index: 40;
    background: var(--soc-navbg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--soc-border);
}

.social-controls-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: center;
}

.social-feed-tabs {
    display: flex;
    gap: 4px;
    justify-content: center;
    padding: 4px;
    background: var(--soc-surface-alt);
    border: 1px solid var(--soc-border);
    border-radius: var(--soc-r-pill);
}

.social-feed-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.125rem;
    background: transparent;
    border: none;
    border-radius: var(--soc-r-pill);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--soc-ink-3);
    cursor: pointer;
    transition: all 0.15s var(--soc-ease);
}

.social-feed-tab:hover { color: var(--soc-ink); }

.social-feed-tab.active {
    background: var(--soc-surface);
    color: var(--soc-primary-deep);
    box-shadow: var(--soc-shadow-xs);
}

body.dark-mode .social-feed-tab.active { color: var(--soc-primary-light); }

.social-feed-tab i { font-size: 1.05rem; }

.social-feed-tab:focus-visible {
    outline: 2px solid var(--soc-primary);
    outline-offset: 2px;
}

/* ==============================================
   FEED COLUMN
   ============================================== */

.social-feed-section {
    padding: 1.5rem 0 5rem 0;
}

.social-feed-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Feed loading */
.social-feed-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 4rem 2rem;
    text-align: center;
}

.social-feed-spinner {
    width: 38px;
    height: 38px;
    border: 3px solid var(--soc-border);
    border-top-color: var(--soc-primary);
    border-radius: 50%;
    animation: social-spin 0.8s linear infinite;
}

.social-feed-spinner.small {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.social-feed-loading-text {
    color: var(--soc-ink-3);
    font-size: 0.9375rem;
    font-weight: 500;
    margin: 0;
}

/* Feed empty state */
.social-feed-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    max-width: 420px;
    margin: 0 auto;
    padding: 3.5rem 1.5rem;
    background: var(--soc-surface);
    border: 1px solid var(--soc-border);
    border-radius: var(--soc-r-xl);
    box-shadow: var(--soc-shadow-sm);
    animation: social-fade 0.32s var(--soc-ease) both;
}

.social-feed-empty-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 180, 255, 0.12);
    border-radius: var(--soc-r-pill);
}

.social-feed-empty-icon i {
    font-size: 2rem;
    color: var(--soc-primary);
}

.social-feed-empty-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--soc-ink);
    margin: 0 0 0.5rem 0;
}

.social-feed-empty-description {
    font-size: 0.9375rem;
    color: var(--soc-ink-2);
    line-height: 1.5;
    margin: 0 0 1.25rem 0;
    max-width: 340px;
}

.social-feed-empty-actions {
    display: flex;
    gap: 0.625rem;
    flex-wrap: wrap;
    justify-content: center;
}

.social-feed-empty-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1.125rem;
    border-radius: var(--soc-r-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s var(--soc-ease);
    border: none;
}

.social-feed-empty-btn.primary {
    background: var(--soc-primary);
    color: #FFFFFF;
    box-shadow: var(--soc-shadow-blue);
}

.social-feed-empty-btn.primary:hover {
    background: var(--soc-primary-deep);
    transform: translateY(-1px);
}

.social-feed-empty-btn:focus-visible {
    outline: 2px solid var(--soc-primary);
    outline-offset: 2px;
}

.social-feed-empty-suggestions {
    margin-top: 1.5rem;
}

/* Feed posts */
.social-feed-posts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* The post WRAPPER. The inner card is the shared SocialPostCard
   (user-profile.css) -- not restyled here. */
.social-feed-post {
    background: var(--soc-surface);
    border: 1px solid var(--soc-border);
    border-radius: var(--soc-r-lg);
    box-shadow: var(--soc-shadow-sm);
    overflow: hidden;
    transition: box-shadow 0.2s var(--soc-ease);
    animation: social-fade 0.32s var(--soc-ease) both;
}

.social-feed-post:hover {
    box-shadow: var(--soc-shadow-md);
}

.social-feed-post.highlighted {
    border: 2px solid var(--soc-primary);
    box-shadow: var(--soc-shadow-blue);
}

/* Loading more */
.social-feed-loading-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 1.25rem;
    color: var(--soc-ink-3);
    font-size: 0.875rem;
    font-weight: 500;
}

/* End of feed */
.social-feed-end {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.875rem;
    padding: 1rem 0 0.25rem 0;
    margin-top: 0.5rem;
    color: var(--soc-ink-3);
}

.social-feed-end-line {
    flex: 1;
    height: 1px;
    background: var(--soc-border);
}

.social-feed-end-text {
    color: var(--soc-ink-3);
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
}

/* ==============================================
   COMPOSE PROMPT
   (styling kept + tokenized for when the Connect page wires up a
   composer; currently has no Razor consumer.)
   ============================================== */

.social-compose-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--soc-surface);
    border: 1px solid var(--soc-border);
    border-radius: var(--soc-r-lg);
    box-shadow: var(--soc-shadow-sm);
    padding: 0.75rem 0.875rem;
    margin-bottom: 0;
}

.social-compose-avatar {
    width: 42px;
    height: 42px;
    border-radius: var(--soc-r-pill);
    background: linear-gradient(135deg, var(--soc-primary), var(--soc-primary-deep));
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9375rem;
    flex-shrink: 0;
    overflow: hidden;
}

.social-compose-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.social-compose-input-wrapper {
    flex: 1;
    min-width: 0;
    padding: 0.7rem 1rem;
    background: var(--soc-surface-alt);
    border: 1px solid var(--soc-border-subtle);
    border-radius: var(--soc-r-pill);
    cursor: text;
    transition: background 0.15s var(--soc-ease);
}

.social-compose-input-wrapper:hover {
    border-color: var(--soc-primary);
}

.social-compose-placeholder {
    color: var(--soc-ink-3);
    font-size: 0.9375rem;
    user-select: none;
}

.social-compose-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.7rem 1.125rem;
    background: var(--soc-primary);
    color: #FFFFFF;
    border: none;
    border-radius: var(--soc-r-pill);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s var(--soc-ease);
    flex-shrink: 0;
    box-shadow: var(--soc-shadow-blue);
}

.social-compose-btn:hover {
    background: var(--soc-primary-deep);
    transform: translateY(-1px);
}

/* Expanded composer state (textarea + actions). Tokens auto-swap under
   body.dark-mode, so no separate dark rules are needed. */
.social-compose-card.expanded {
    align-items: flex-start;
}

.social-compose-expanded {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.social-compose-textarea {
    width: 100%;
    resize: vertical;
    min-height: 64px;
    padding: 0.7rem 1rem;
    background: var(--soc-surface-alt);
    border: 1px solid var(--soc-border-subtle);
    border-radius: var(--soc-r-lg);
    color: var(--soc-ink);
    font: inherit;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.social-compose-textarea:focus {
    outline: none;
    border-color: var(--soc-primary);
}

.social-compose-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.social-compose-counter {
    margin-right: auto;
    font-size: 0.8125rem;
    color: var(--soc-ink-3);
}

.social-compose-cancel {
    background: none;
    border: none;
    color: var(--soc-ink-2);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: var(--soc-r-pill);
}

.social-compose-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.social-compose-wrapper {
    margin-bottom: 1rem;
}

/* ==============================================
   RESPONSIVE
   ============================================== */

@media (max-width: 768px) {
    .social-header-section {
        padding: 6.5rem 0 1.75rem 0;
    }

    .social-header-container {
        padding: 0 1rem;
    }

    .social-icon {
        width: 60px;
        height: 60px;
        font-size: 1.65rem;
    }

    .social-controls-section {
        top: 60px;
    }

    .social-controls-container {
        padding: 0 1rem;
    }

    .social-feed-container {
        padding: 0 0.875rem;
    }

    .social-feed-tab {
        padding: 0.5rem 1rem;
    }

    .social-feed-section {
        padding: 1.25rem 0 calc(80px + 2rem) 0;
    }
}

@media (max-width: 480px) {
    .social-header-section {
        padding: 6rem 0 1.5rem 0;
    }

    .social-feed-tab {
        padding: 0.5rem 0.875rem;
    }

    .social-compose-card {
        padding: 0.625rem 0.75rem;
    }

    .social-compose-btn {
        padding: 0.6rem 0.9rem;
    }
}
