/* ============================================================================
   MEDALLION XLN - Creator Feed Styles
   Location: /public_html/posts/assets/styles.css
   
   Design Philosophy: Media-First, Trust-Driven
   - UI frames content, never competes with it
   - Soft depth through subtle shadows and elevation
   - Calm power with restrained motion
   - Professional ecosystem energy
   ============================================================================ */

/* ============================================================================
   DESIGN TOKENS
   ============================================================================ */

:root {
    /* Brand Colors */
    --gold: #F9C94C;
    --gold-soft: #FDF4DC;
    --orange: #F28E1C;
    --primary-grad: linear-gradient(135deg, #F9C94C 0%, #F28E1C 100%);

    /* Accent Colors */
    --accent-purple: #7C3AED;
    --accent-blue: #3B82F6;
    --accent-cyan: #06B6D4;
    --accent-rose: #F43F5E;
    --accent-emerald: #10B981;

    /* Neutral Palette - Muted surfaces let media shine */
    --surface-ground: #F8FAFC;
    --surface-card: #FFFFFF;
    --surface-elevated: #FFFFFF;
    --surface-overlay: rgba(15, 23, 42, 0.6);

    /* Text - Clean hierarchy */
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-subtle: #CBD5E1;

    /* Borders - Soft separation */
    --border-light: #F1F5F9;
    --border-default: #E2E8F0;
    --border-emphasis: #CBD5E1;

    /* Shadows - Soft depth, not flatness */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08), 0 4px 8px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 24px 48px rgba(15, 23, 42, 0.12), 0 8px 16px rgba(15, 23, 42, 0.06);
    --shadow-glow: 0 0 0 3px rgba(249, 201, 76, 0.15);
    --shadow-focus: 0 0 0 3px rgba(59, 130, 246, 0.12);

    /* Spacing - Consistent rhythm */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;

    /* Radii - Generous, approachable */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Transitions - Motion as feedback */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --duration-fast: 150ms;
    --duration-normal: 200ms;
    --duration-slow: 300ms;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Space Grotesk', var(--font-sans);

    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-modal: 1000;
    --z-toast: 1100;
}

/* ============================================================================
   POST CARD - The Foundation
   Clean frame that lets content breathe
   ============================================================================ */

.post {
    background: var(--surface-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition:
        box-shadow var(--duration-normal) var(--ease-out),
        transform var(--duration-normal) var(--ease-out);
}

.post:hover {
    box-shadow: var(--shadow-md);
}

/* Post inner content wrapper */
.post-content-wrapper {
    padding: var(--space-6);
}

/* ============================================================================
   POST HEADER - Author Identity
   Clear, scannable, trust-building
   ============================================================================ */

.post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-6);
    gap: var(--space-3);
}

.post-header-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
    min-width: 0;
}

.post-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-light);
    transition: border-color var(--duration-fast) var(--ease-out);
}

.post-avatar:hover {
    border-color: var(--gold);
}

.post-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.post-author {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.post-author:hover {
    color: var(--gold);
    cursor: pointer;
}

/* Verified badge */
.post-author .verified-badge {
    width: 16px;
    height: 16px;
    color: var(--accent-blue);
}

.post-timestamp {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Community tag */
.post-community-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: 12px;
    color: var(--accent-purple);
    background: rgba(124, 58, 237, 0.08);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-left: var(--space-2);
}

.post-community-tag:hover {
    background: rgba(124, 58, 237, 0.12);
}

/* ============================================================================
   POST TEXT CONTENT
   Context, not dominance - readable without overwhelming
   ============================================================================ */

.post-text {
    padding: 0 var(--space-6) var(--space-5);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 65ch;
    /* Optimal reading length */
    word-wrap: break-word;
}

.post-text p {
    margin: 0 0 var(--space-3);
}

.post-text p:last-child {
    margin-bottom: 0;
}

/* Expandable long text */
.post-text.truncated {
    max-height: 120px;
    overflow: hidden;
    position: relative;
}

.post-text.truncated::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, var(--surface-card));
}

.post-expand-btn {
    background: none;
    border: none;
    color: var(--accent-blue);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: var(--space-2) var(--space-6);
    transition: color var(--duration-fast);
}

.post-expand-btn:hover {
    color: var(--text-primary);
}

/* ============================================================================
   POST MEDIA - The Hero
   Media-first: this is the star of the show
   ============================================================================ */

.post-media {
    position: relative;
    width: 100%;
    background: var(--surface-ground);
    overflow: hidden;
}

/* ============================================================================
   IMAGE MEDIA - Gallery Grade
   Edge-to-edge, clean frame, let composition speak
   ============================================================================ */

.post-media.image-media {
    border-radius: 0;
    /* Edge-to-edge within card */
}

.post-media.image-media img {
    width: 100%;
    height: auto;
    max-height: 900px;
    object-fit: contain;
    display: block;
    background: #0a0a0a;
}

/* Image loading state */
.post-media.image-media.loading {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-media.image-media.loading::after {
    content: '';
    width: 32px;
    height: 32px;
    border: 2px solid var(--border-default);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Multi-image grid */
.post-media-grid {
    display: grid;
    gap: 2px;
}

.post-media-grid.grid-2 {
    grid-template-columns: 1fr 1fr;
}

.post-media-grid.grid-3 {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.post-media-grid.grid-3 img:first-child {
    grid-row: span 2;
}

.post-media-grid.grid-4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.post-media-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: opacity var(--duration-fast);
}

.post-media-grid img:hover {
    opacity: 0.92;
}

/* ============================================================================
   VIDEO MEDIA - Cinematic Treatment
   Clear play affordance, letterboxing, deliberate controls
   ============================================================================ */

.post-media.video-media {
    background: #000;
    position: relative;
}

.post-media.video-media video {
    width: 100%;
    height: auto;
    max-height: 70vh;
    display: block;
    object-fit: contain;
}

/* Video overlay for play state */
.video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: background var(--duration-normal) var(--ease-out);
}

.video-overlay:hover {
    background: rgba(0, 0, 0, 0.35);
}

.video-overlay.playing {
    opacity: 0;
    pointer-events: none;
}

/* Large, confident play button */
.video-play-btn {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.95);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition:
        transform var(--duration-normal) var(--ease-out),
        box-shadow var(--duration-normal) var(--ease-out);
}

.video-play-btn:hover {
    transform: scale(1.08);
    box-shadow: var(--shadow-xl);
}

.video-play-btn svg,
.video-play-btn .iconify {
    width: 32px;
    height: 32px;
    color: var(--text-primary);
    margin-left: 4px;
    /* Optical centering for play icon */
}

/* Video duration badge */
.video-duration {
    position: absolute;
    bottom: var(--space-4);
    right: var(--space-4);
    background: rgba(0, 0, 0, 0.75);
    color: white;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    backdrop-filter: blur(4px);
}

/* Video progress bar */
.video-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
}

.video-progress-bar {
    height: 100%;
    background: var(--gold);
    width: 0%;
    transition: width 0.1s linear;
}

/* ============================================================================
   AUDIO MEDIA - Spotify-Inspired Player
   Polished, recognizable, trustworthy
   ============================================================================ */

.post-media.audio-media {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: var(--space-6);
    border-radius: 0;
}

.audio-player {
    display: flex;
    align-items: center;
    gap: var(--space-5);
}

.audio-artwork {
    width: 72px;
    height: 72px;
    min-width: 72px;
    background: linear-gradient(135deg, var(--gold), var(--orange));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.audio-artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.audio-artwork svg,
.audio-artwork .iconify {
    width: 32px;
    height: 32px;
    color: white;
}

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

.audio-title {
    font-size: 15px;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audio-artist {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.audio-play-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform var(--duration-fast) var(--ease-out);
}

.audio-play-btn:hover {
    transform: scale(1.06);
}

.audio-play-btn svg,
.audio-play-btn .iconify {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
    margin-left: 2px;
}

.audio-play-btn.playing svg,
.audio-play-btn.playing .iconify {
    margin-left: 0;
}

/* Audio waveform visualization */
.audio-waveform {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 32px;
    padding: 0 var(--space-3);
}

.audio-waveform-bar {
    width: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    transition: height 0.1s ease;
}

.audio-waveform-bar.active {
    background: var(--gold);
}

/* Audio progress */
.audio-progress-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.audio-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-variant-numeric: tabular-nums;
    min-width: 36px;
}

.audio-progress-track {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.audio-progress-fill {
    height: 100%;
    background: white;
    border-radius: 2px;
    width: 0%;
    position: relative;
}

.audio-progress-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    transition: opacity var(--duration-fast);
}

.audio-progress-track:hover .audio-progress-fill::after {
    opacity: 1;
}

/* ============================================================================
   DOCUMENT/PDF MEDIA - First-Class Assets
   Inline preview, clear navigation, encourages engagement
   ============================================================================ */

.post-media.document-media {
    background: var(--surface-ground);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.document-viewer {
    display: flex;
    flex-direction: column;
}

/* Document header with controls */
.document-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    background: var(--surface-card);
    border-bottom: 1px solid var(--border-light);
}

.document-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.document-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.document-icon svg,
.document-icon .iconify {
    width: 20px;
    height: 20px;
}

.document-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.document-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.document-size {
    font-size: 12px;
    color: var(--text-muted);
}

.document-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.document-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--surface-ground);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--duration-fast) var(--ease-out);
}

.document-action-btn:hover {
    background: var(--surface-card);
    border-color: var(--border-emphasis);
    color: var(--text-primary);
}

.document-action-btn.primary {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: white;
}

.document-action-btn.primary:hover {
    background: var(--text-secondary);
}

/* Document preview canvas */
.document-preview {
    position: relative;
    background: #525659;
    min-height: 400px;
    max-height: 600px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.document-canvas {
    max-width: 100%;
    max-height: 100%;
    box-shadow: var(--shadow-lg);
}

/* Document navigation */
.document-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--surface-card);
    border-top: 1px solid var(--border-light);
}

.document-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--surface-ground);
    border: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--duration-fast) var(--ease-out);
}

.document-nav-btn:hover:not(:disabled) {
    background: var(--surface-card);
    border-color: var(--border-emphasis);
    color: var(--text-primary);
}

.document-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.document-page-info {
    font-size: 14px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.document-page-info strong {
    color: var(--text-primary);
}

/* ============================================================================
   POST REACTIONS - Natural, Calm Interactions
   ============================================================================ */

.post-reactions {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-3) var(--space-6) var(--space-5);
    border-top: 1px solid var(--border-light);
    margin-top: auto;
}

.reaction-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--duration-fast) var(--ease-out);
}

.reaction-btn:hover {
    background: var(--surface-ground);
    color: var(--text-secondary);
}

.reaction-btn.active {
    color: var(--accent-rose);
}

.reaction-btn.active .reaction-icon {
    transform: scale(1.1);
}

.reaction-icon {
    font-size: 20px;
    line-height: 1;
    transition: transform var(--duration-fast) var(--ease-out);
}

.reaction-count {
    font-variant-numeric: tabular-nums;
    min-width: 16px;
}

/* Reaction animation */
@keyframes reaction-pop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1.1);
    }
}

.reaction-btn.animating .reaction-icon {
    animation: reaction-pop 0.3s var(--ease-out);
}

/* ============================================================================
   POST MENU - Contextual Actions
   ============================================================================ */

.post-header-actions {
    position: relative;
    display: flex;
    align-items: center;
}

.post-menu-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--duration-fast) var(--ease-out);
}

.post-menu-btn:hover {
    background: var(--surface-ground);
    color: var(--text-secondary);
}

.post-menu {
    position: absolute;
    top: calc(100% + var(--space-2));
    right: 0;
    background: var(--surface-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    overflow: hidden;
    z-index: var(--z-dropdown);
    animation: menu-enter var(--duration-fast) var(--ease-out);
}

@keyframes menu-enter {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.post-menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: none;
    border: none;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-fast);
    text-align: left;
}

.post-menu-item:hover {
    background: var(--surface-ground);
    color: var(--text-primary);
}

.post-menu-item.delete {
    color: var(--accent-rose);
}

.post-menu-item.delete:hover {
    background: rgba(244, 63, 94, 0.08);
}

.post-menu-item .iconify {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

.post-menu-divider {
    height: 1px;
    background: var(--border-light);
    margin: var(--space-2) 0;
}

/* ============================================================================
   POST CREATION - Inviting, Clear
   ============================================================================ */

.create-post-card {
    background: var(--surface-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: var(--space-6);
}

.create-post-header {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-5);
}

.create-post-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-light);
}

.create-post-input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.create-post-input {
    width: 100%;
    min-height: 60px;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: var(--font-sans);
    color: var(--text-primary);
    resize: none;
    outline: none;
    transition: all var(--duration-fast) var(--ease-out);
}

.create-post-input:focus {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-focus);
}

.create-post-input::placeholder {
    color: var(--text-muted);
}

/* File upload buttons */
.file-upload-buttons {
    display: flex;
    gap: var(--space-2);
    padding: 0 var(--space-5) var(--space-4);
}

.file-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
    background: var(--surface-card);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.file-btn:hover {
    border-color: var(--border-emphasis);
    color: var(--text-secondary);
}

.file-btn.image-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.06);
}

.file-btn.video-btn:hover {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
    background: rgba(124, 58, 237, 0.06);
}

.file-btn.audio-btn:hover {
    border-color: var(--accent-emerald);
    color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.06);
}

.file-btn.document-btn:hover {
    border-color: var(--accent-rose);
    color: var(--accent-rose);
    background: rgba(244, 63, 94, 0.06);
}

/* Create post footer */
.create-post-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    background: var(--surface-ground);
    border-top: 1px solid var(--border-light);
}

.file-info-text {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 13px;
    color: var(--text-muted);
}

.post-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-width: 100px;
    padding: var(--space-3) var(--space-5);
    background: var(--primary-grad);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.post-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 201, 76, 0.35);
}

.post-btn:active:not(:disabled) {
    transform: translateY(0);
}

.post-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================================
   FILE PREVIEW - Before posting
   ============================================================================ */

.file-preview {
    margin: 0 var(--space-5) var(--space-4);
    padding: var(--space-4);
    background: var(--surface-ground);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.file-preview-thumbnail {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--border-light);
}

.file-preview-info {
    flex: 1;
    min-width: 0;
}

.file-preview-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-preview-size {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.file-preview-remove {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-fast);
}

.file-preview-remove:hover {
    background: rgba(244, 63, 94, 0.1);
    color: var(--accent-rose);
}

/* ============================================================================
   COMMENTS SECTION - Threaded, Scannable
   ============================================================================ */

.post-comments-section {
    border-top: 1px solid var(--border-light);
    padding: var(--space-5) var(--space-6);
}

.comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.comments-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.comments-sort-dropdown {
    font-size: 13px;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--surface-card);
    color: var(--text-secondary);
    cursor: pointer;
}

/* Comment input */
.comments-input-box {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.comments-input-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
}

.comments-input-wrapper {
    flex: 1;
    position: relative;
}

.comments-input-field {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-family: var(--font-sans);
    color: var(--text-primary);
    resize: none;
    outline: none;
    transition: all var(--duration-fast) var(--ease-out);
}

.comments-input-field:focus {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-focus);
}

.comments-input-field::placeholder {
    color: var(--text-muted);
}

/* Comment list */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.comment-item {
    display: flex;
    gap: var(--space-3);
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
    cursor: pointer;
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-bubble {
    background: var(--surface-ground);
    border-radius: var(--radius-lg);
    padding: var(--space-3) var(--space-4);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: 4px;
}

.comment-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
}

.comment-name:hover {
    color: var(--gold);
}

.comment-time {
    font-size: 12px;
    color: var(--text-muted);
}

.comment-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
    word-wrap: break-word;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-top: var(--space-2);
    padding-left: var(--space-4);
}

.comment-action-btn {
    background: none;
    border: none;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color var(--duration-fast);
}

.comment-action-btn:hover {
    color: var(--text-secondary);
}

.no-comments {
    text-align: center;
    padding: var(--space-8);
    color: var(--text-muted);
    font-size: 14px;
}

/* ============================================================================
   POSTS LIST CONTAINER
   ============================================================================ */

.posts-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

/* ============================================================================
   EMPTY STATE
   ============================================================================ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12) var(--space-6);
    text-align: center;
}

.empty-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background: var(--surface-ground);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-5);
    color: var(--text-subtle);
}

.empty-icon svg,
.empty-icon .iconify {
    width: 40px;
    height: 40px;
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.empty-description {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 300px;
}

/* ============================================================================
   LOADING STATES
   ============================================================================ */

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid var(--border-default);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg,
            var(--border-light) 25%,
            var(--surface-ground) 50%,
            var(--border-light) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

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

    100% {
        background-position: -200% 0;
    }
}

.post-skeleton {
    background: var(--surface-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
}

.post-skeleton-header {
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.post-skeleton-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.post-skeleton-meta {
    flex: 1;
}

.post-skeleton-name {
    height: 14px;
    width: 120px;
    margin-bottom: var(--space-2);
}

.post-skeleton-time {
    height: 12px;
    width: 80px;
}

.post-skeleton-content {
    height: 60px;
    margin-bottom: var(--space-4);
}

.post-skeleton-media {
    height: 300px;
    border-radius: var(--radius-md);
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
    .post-header {
        padding: var(--space-4);
    }

    .post-text {
        padding: 0 var(--space-4) var(--space-4);
        font-size: 14px;
    }

    .post-reactions {
        padding: var(--space-3) var(--space-4);
    }

    .reaction-btn {
        padding: var(--space-2) var(--space-3);
    }

    .reaction-count {
        display: none;
    }

    .video-play-btn {
        width: 64px;
        height: 64px;
    }

    .video-play-btn svg,
    .video-play-btn .iconify {
        width: 24px;
        height: 24px;
    }

    .audio-player {
        flex-direction: column;
        text-align: center;
    }

    .audio-progress-container {
        width: 100%;
    }

    .document-header {
        flex-direction: column;
        gap: var(--space-3);
    }

    .document-actions {
        width: 100%;
    }

    .document-action-btn {
        flex: 1;
        justify-content: center;
    }

    .create-post-header {
        padding: var(--space-4);
    }

    .create-post-avatar {
        width: 40px;
        height: 40px;
    }

    .file-upload-buttons {
        padding: 0 var(--space-4) var(--space-3);
    }

    .create-post-footer {
        padding: var(--space-3) var(--space-4);
    }

    .post-comments-section {
        padding: var(--space-4);
    }
}

@media (max-width: 480px) {
    .post-avatar {
        width: 40px;
        height: 40px;
    }

    .post-author {
        font-size: 14px;
    }

    .file-btn {
        width: 36px;
        height: 36px;
    }

    .post-btn {
        min-width: auto;
        padding: var(--space-2) var(--space-4);
        font-size: 13px;
    }
}

/* ============================================================================
   DARK MODE SUPPORT
   ============================================================================ */

@media (prefers-color-scheme: dark) {
    :root {
        --surface-ground: #0F172A;
        --surface-card: #1E293B;
        --surface-elevated: #334155;

        --text-primary: #F1F5F9;
        --text-secondary: #CBD5E1;
        --text-muted: #94A3B8;
        --text-subtle: #64748B;

        --border-light: #334155;
        --border-default: #475569;
        --border-emphasis: #64748B;

        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
        --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
        --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.3);
    }

    .post-media.image-media img {
        background: #000;
    }

    .post-text.truncated::after {
        background: linear-gradient(transparent, var(--surface-card));
    }
}

/* ============================================================================
   EDIT POST MODAL
   ============================================================================ */

.edit-post-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--surface-overlay);
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    backdrop-filter: blur(4px);
}

.edit-post-modal.active {
    display: flex;
}

.edit-post-modal-content {
    background: var(--surface-card);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modal-enter var(--duration-normal) var(--ease-out);
}

@keyframes modal-enter {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.edit-post-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border-light);
}

.edit-post-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.edit-post-modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all var(--duration-fast);
}

.edit-post-modal-close:hover {
    background: var(--surface-ground);
    color: var(--text-primary);
}

.edit-post-form {
    padding: var(--space-6);
}

.edit-post-textarea {
    width: 100%;
    min-height: 150px;
    padding: var(--space-4);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--surface-card);
    resize: vertical;
    outline: none;
    transition: all var(--duration-fast);
}

.edit-post-textarea:focus {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-focus);
}

.edit-post-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-6);
    border-top: 1px solid var(--border-light);
}

.edit-post-cancel-btn {
    padding: var(--space-3) var(--space-5);
    background: var(--surface-ground);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-fast);
}

.edit-post-cancel-btn:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.edit-post-save-btn {
    padding: var(--space-3) var(--space-5);
    background: var(--primary-grad);
    border: none;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all var(--duration-fast);
}

.edit-post-save-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 201, 76, 0.35);
}

.edit-post-save-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}