/* ============================================================================
   MEDALLION XLN - Post Feed Improvements
   Location: /public_html/posts/assets/feed-fixes.css
   
   Targeted fixes based on live feed analysis
   ============================================================================ */

/* ============================================================================
   1. IMPROVED TEXT CONTRAST
   Post text was too faint - increase readability
   ============================================================================ */

.post-text,
.post-content,
.post-body p,
.post p {
    color: #E2E8F0 !important;
    /* Much lighter - was too dark */
    font-size: 15px;
    line-height: 1.6;
    letter-spacing: 0.01em;
}

/* Ensure text is always readable on dark backgrounds */
.post .post-text,
.post-card .post-text {
    color: #F1F5F9 !important;
}

/* ============================================================================
   2. SOFTER AUTHOR SECTION
   Remove heavy dark band, create smoother visual flow
   ============================================================================ */

.post-header,
.post-author-section,
.post-info {
    background: transparent !important;
    /* Remove solid dark band */
    padding: 16px 20px;
}

/* Author name - make it pop */
.post-author-name,
.post-meta b,
.post-header b,
.post-name {
    color: #F8FAFC !important;
    font-weight: 600;
    font-size: 15px;
}

/* Timestamp - subtle but readable */
.post-timestamp,
.post-date,
.post-time,
.post-meta span {
    color: #94A3B8 !important;
    font-size: 13px;
}

/* Avatar ring on hover */
.post-avatar {
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.post-avatar:hover {
    border-color: #F9C94C;
}

/* ============================================================================
   3. BETTER IMAGE HANDLING
   Prevent awkward cropping, respect aspect ratios
   ============================================================================ */

/* Default: contain images to show full content */
.post-media img,
.post-image img,
.image-media img {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    /* Show full image, don't crop */
    background: #0a0a0a;
    /* Dark bg for letterboxing */
}

/* For images that SHOULD fill (cover photos, banners) */
.post-media.cover-image img,
.post-media[data-fit="cover"] img {
    object-fit: cover;
    object-position: center top;
    /* Favor faces/top content */
}

/* Tall images (portraits) - limit height more aggressively */
.post-media img[data-orientation="portrait"] {
    max-height: 500px;
}

/* Wide images (landscapes) - can be taller */
.post-media img[data-orientation="landscape"] {
    max-height: 700px;
}

/* ============================================================================
   4. VIDEO PROGRESS BAR - Brand Colors
   Replace red with gold
   ============================================================================ */

/* Native video controls override */
video::-webkit-media-controls-timeline {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Custom progress bar */
.video-progress,
.video-progress-bar {
    background: rgba(255, 255, 255, 0.15);
}

.video-progress-fill,
.video-progress-bar .progress,
.video-progress .filled {
    background: linear-gradient(90deg, #F9C94C, #F28E1C) !important;
}

/* Progress dot/thumb */
.video-progress-thumb,
.video-scrubber,
.progress-dot {
    background: #F9C94C !important;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ============================================================================
   5. CARD DEPTH & ELEVATION
   Add subtle shadows for depth
   ============================================================================ */

.post,
.post-card,
.feed-post {
    background: #1E293B;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.12),
        0 4px 12px rgba(0, 0, 0, 0.08);
    transition:
        box-shadow 0.2s ease,
        transform 0.2s ease,
        border-color 0.2s ease;
    overflow: hidden;
}

.post:hover,
.post-card:hover,
.feed-post:hover {
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: rgba(255, 255, 255, 0.1);
}

/* ============================================================================
   6. REACTIONS - Better Spacing & Hover
   ============================================================================ */

.post-reactions,
.post-actions,
.reaction-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.reaction-btn,
.post-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    background: transparent;
    border: none;
    color: #94A3B8;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.reaction-btn:hover,
.post-action-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #E2E8F0;
}

/* Active/liked state */
.reaction-btn.active,
.reaction-btn.liked {
    color: #F43F5E;
}

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

/* Icon sizing */
.reaction-icon,
.post-action-btn svg,
.post-action-btn .iconify {
    width: 20px;
    height: 20px;
}

/* Count number */
.reaction-count {
    font-variant-numeric: tabular-nums;
    min-width: 12px;
}

/* ============================================================================
   7. REPOST INDICATOR - Cleaner
   ============================================================================ */

.repost-indicator,
.reposted-by {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 13px;
    color: #64748B;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.repost-indicator svg,
.reposted-by svg,
.repost-indicator .iconify,
.reposted-by .iconify {
    width: 16px;
    height: 16px;
    color: #64748B;
}

.repost-indicator a,
.reposted-by a,
.repost-indicator .name,
.reposted-by .name {
    color: #94A3B8;
    font-weight: 500;
    text-decoration: none;
}

.repost-indicator a:hover,
.reposted-by a:hover {
    color: #F9C94C;
}

/* ============================================================================
   8. PDF/DOCUMENT CONTROLS - Polish
   ============================================================================ */

.pdf-controls,
.document-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
    background: #1E293B;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pdf-nav-btn,
.document-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pdf-nav-btn:hover:not(:disabled),
.document-nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

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

.pdf-page-info,
.document-page-info {
    font-size: 14px;
    color: #94A3B8;
    font-variant-numeric: tabular-nums;
    min-width: 60px;
    text-align: center;
}

.pdf-download-btn,
.document-download-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pdf-download-btn:hover,
.document-download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* ============================================================================
   9. VIDEO - Native Controls (Don't block playback)
   ============================================================================ */

/* Let native video controls work */
.post-media.video-media {
    position: relative;
    background: #000;
}

.post-media.video-media video {
    width: 100%;
    height: auto;
    max-height: 70vh;
    display: block;
    cursor: pointer;
}

/* Duration badge - positioned to not block controls */
.video-duration {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
    pointer-events: none;
    /* Don't block clicks */
}

/* ============================================================================
   10. TEXT-ONLY POSTS - More Visual Interest
   ============================================================================ */

.post.text-only,
.post-card.text-only,
.post:not(:has(.post-media)) {
    /* Add subtle gradient background for text-only posts */
    background: linear-gradient(135deg,
            #1E293B 0%,
            #1a2435 100%);
}

.post.text-only .post-text,
.post-card.text-only .post-text {
    font-size: 17px;
    line-height: 1.65;
    padding: 20px 24px;
}

/* ============================================================================
   11. POST CONTENT FLOW
   Media → Author → Text → Reactions
   ============================================================================ */

.post {
    display: flex;
    flex-direction: column;
}

/* Repost indicator at very top */
.post .repost-indicator {
    order: -2;
}

/* Media first */
.post .post-media,
.post .post-image,
.post .post-video,
.post .post-document {
    order: -1;
}

/* Then author */
.post .post-header {
    order: 0;
}

/* Then text */
.post .post-text,
.post .post-content {
    order: 1;
    padding: 0 20px 16px;
}

/* Reactions last */
.post .post-reactions {
    order: 2;
}

/* ============================================================================
   12. SMOOTH ANIMATIONS
   ============================================================================ */

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

    50% {
        transform: scale(1.3);
    }

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

.reaction-btn.animating .reaction-icon {
    animation: heart-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Card entrance */
@keyframes card-enter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.post {
    animation: card-enter 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Stagger posts */
.post:nth-child(1) {
    animation-delay: 0ms;
}

.post:nth-child(2) {
    animation-delay: 50ms;
}

.post:nth-child(3) {
    animation-delay: 100ms;
}

.post:nth-child(4) {
    animation-delay: 150ms;
}

.post:nth-child(5) {
    animation-delay: 200ms;
}

/* ============================================================================
   13. MOBILE RESPONSIVE
   ============================================================================ */

@media (max-width: 640px) {

    .post,
    .post-card {
        border-radius: 12px;
        margin: 0 -8px;
        /* Bleed to edges on mobile */
    }

    .post-header {
        padding: 12px 16px;
    }

    .post-text {
        padding: 0 16px 12px;
        font-size: 14px;
    }

    .post-reactions {
        padding: 10px 16px 14px;
        gap: 4px;
    }

    .reaction-btn {
        padding: 6px 10px;
        font-size: 13px;
    }

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

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

    .pdf-controls {
        padding: 10px 12px;
        gap: 8px;
    }

    .pdf-nav-btn,
    .pdf-download-btn {
        width: 36px;
        height: 36px;
    }
}

/* ============================================================================
   14. FOCUS STATES (Accessibility)
   ============================================================================ */

.reaction-btn:focus-visible,
.post-action-btn:focus-visible,
.pdf-nav-btn:focus-visible,
.video-play-btn:focus-visible {
    outline: 2px solid #F9C94C;
    outline-offset: 2px;
}

.post-avatar:focus-visible,
.post-author-name:focus-visible {
    outline: 2px solid #F9C94C;
    outline-offset: 2px;
    border-radius: 4px;
}