@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;600;700&display=swap');

/* ── Design Tokens ─────────────────────────────────────────────── */
:root {
    --bg-gradient: linear-gradient(135deg, #080c1a 0%, #0d1230 50%, #130c2e 100%);
    --card-bg: rgba(255, 255, 255, 0.032);
    --card-bg-hover: rgba(255, 255, 255, 0.048);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(99, 102, 241, 0.3);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-accent: #818cf8;
    --text-muted: #475569;

    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --accent-glow: rgba(99, 102, 241, 0.4);
    --hover-bg: rgba(255, 255, 255, 0.06);

    --video-gradient: linear-gradient(180deg, rgba(0, 0, 0, 0) 60%, rgba(6, 8, 20, 0.95) 100%);
    --audio-bg: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    --doc-bg: linear-gradient(135deg, rgba(16, 185, 129, 0.06) 0%, rgba(6, 182, 212, 0.06) 100%);

    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;

    --shadow-card: 0 32px 64px -16px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05);
    --shadow-media: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
    --shadow-btn: 0 12px 32px -8px rgba(99, 102, 241, 0.55);
    --shadow-btn-hover: 0 18px 40px -8px rgba(99, 102, 241, 0.75);
    --shadow-glow: 0 0 60px -10px rgba(99, 102, 241, 0.25);
}

/* ── Reset ─────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Body ──────────────────────────────────────────────────────── */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Ambient Orbs ──────────────────────────────────────────────── */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

body::before {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, transparent 70%);
    top: -15%;
    left: -10%;
    animation: orb-drift 18s ease-in-out infinite alternate;
}

body::after {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.14) 0%, transparent 70%);
    bottom: -10%;
    right: -8%;
    animation: orb-drift 22s ease-in-out infinite alternate-reverse;
}

@keyframes orb-drift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(40px, 30px) scale(1.15);
    }
}

/* ── Page Container ────────────────────────────────────────────── */
.page-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 1.5rem;
    position: relative;
    z-index: 1;
}

/* Noise texture overlay */
.page-container::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

/* ── Post Card ─────────────────────────────────────────────────── */
.post-card {
    width: 100%;
    max-width: 680px;
    background: var(--card-bg);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-card), var(--shadow-glow);
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
        box-shadow 0.4s cubic-bezier(0.23, 1, 0.32, 1),
        border-color 0.4s ease;
    position: relative;
    z-index: 2;
}

/* Top accent line */
.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.6), rgba(99, 102, 241, 0.8), rgba(139, 92, 246, 0.6), transparent);
    z-index: 3;
}

.post-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.8), 0 0 80px -15px rgba(99, 102, 241, 0.3);
    border-color: var(--border-glow);
}

/* ── Header ────────────────────────────────────────────────────── */
.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 2rem 2rem 1.75rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.04) 0%, transparent 100%);
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 1;
    min-width: 0;
}

.post-title {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1.55rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #c7d2fe 60%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.post-meta {
    font-size: 0.875rem !important;
    color: var(--text-accent) !important;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.post-meta::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--text-accent);
    border-radius: 50%;
    opacity: 0.7;
    flex-shrink: 0;
}

.post-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 500;
}

.status-badge {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(6, 182, 212, 0.12));
    color: #34d399;
    padding: 0.35rem 1rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid rgba(52, 211, 153, 0.25);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    margin-left: 1rem;
    flex-shrink: 0;
    box-shadow: 0 0 16px -4px rgba(52, 211, 153, 0.25);
}

/* ── Media Wrapper ─────────────────────────────────────────────── */
.media-wrapper {
    width: 100%;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    position: relative;
    overflow: hidden;
}

/* ── VIDEO Player ──────────────────────────────────────────────── */
.post-video {
    width: 100%;
    max-height: 420px;
    background: #000;
    object-fit: contain;
    outline: none;
    display: block;
    border-radius: 0;
    /* Custom shadow on focus */
    transition: box-shadow 0.3s ease;
}

.post-video:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(99, 102, 241, 0.6);
}

/* Chromium-based video controls theming via accent-color */
.post-video {
    accent-color: #818cf8;
}

/* Video wrapper glow shimmer on load */
.media-wrapper:has(.post-video[style*="block"])::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 70%, rgba(8, 12, 26, 0.6) 100%);
    pointer-events: none;
}

/* ── Audio Player ─────────────────────────────────────────────── */
/* Native controls — let browser render naturally, just accent it */
.post-audio {
    width: 100%;
    display: block;
    accent-color: #818cf8;
    border-radius: var(--radius-sm);
}

/* ── Document / PDF ──────────────────────────────────────────── */
/* Outer container — display:none/block controlled by JS inline.  */
/* IMPORTANT: do NOT set display here — inline style must win.    */
.post-document {
    width: 100%;
    position: relative;
    background: var(--doc-bg);
    min-height: 220px;
}

/* Inner wrapper handles flex centering */
.doc-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 2.5rem;
    gap: 1.25rem;
    text-align: center;
    min-height: 220px;
    position: relative;
    z-index: 1;
}

/* Decorative PDF icon watermark */
.post-document::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.07) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* PDF icon ring */
.post-document::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110px;
    height: 110px;
    border: 1px solid rgba(16, 185, 129, 0.12);
    border-radius: 50%;
    animation: ring-pulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes ring-pulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.12);
        opacity: 0.2;
    }
}

.post-document a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0.85rem 2.2rem;
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    color: white;
    text-decoration: none;
    border-radius: 99px;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 12px 32px -8px rgba(16, 185, 129, 0.5);
    position: relative;
    z-index: 2;
}

.post-document a:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 20px 44px -8px rgba(16, 185, 129, 0.65);
    filter: brightness(1.08);
}

/* ── Body ──────────────────────────────────────────────────────── */
.post-body {
    padding: 2rem;
}

.description {
    font-size: 1.0rem;
    color: #cbd5e1;
    white-space: pre-wrap;
    line-height: 1.75;
    font-weight: 400;
}

/* ── Footer ────────────────────────────────────────────────────── */
.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid var(--border-color);
}

.stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: default;
    user-select: none;
}

.icon-heart {
    color: #f43f5e;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        filter 0.25s ease;
}

.stats:hover .icon-heart {
    transform: scale(1.28);
    filter: drop-shadow(0 0 6px rgba(244, 63, 94, 0.6));
}

/* ── Comments ──────────────────────────────────────────────────── */
.comments-section {
    padding: 0 2rem 2rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: none !important;
    margin-top: 0 !important;
}

.comments-section h3 {
    font-size: 1.05rem !important;
    margin-bottom: 1rem !important;
    color: var(--text-primary) !important;
    font-weight: 600;
    letter-spacing: -0.01em;
}

#comments-list {
    color: var(--text-secondary) !important;
    font-size: 0.9rem !important;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    border: 1px dashed rgba(255, 255, 255, 0.08);
    text-align: center;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .page-container {
        padding: 0;
        align-items: flex-start;
    }

    .post-card {
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.025);
        backdrop-filter: blur(16px);
        max-width: 100%;
    }

    .post-header,
    .post-body,
    .post-footer,
    .comments-section {
        padding: 1.5rem;
    }

    .post-title {
        font-size: 1.3rem;
    }

    .media-wrapper:has(.post-audio[style*="block"]) {
        padding: 2rem 1.5rem;
    }

    .post-document {
        padding: 2.5rem 1.5rem !important;
    }
}

@media (max-width: 400px) {
    .post-title {
        font-size: 1.15rem;
    }

    .post-document a {
        padding: 0.8rem 1.6rem !important;
        font-size: 0.9rem;
    }
}