/* ============================================================
   OutliveHub — Shorts Feed (Dark Vertical Swipe)
   ============================================================ */

/* --- Body override ----------------------------------------- */

body.shorts-body {
    background: #000;
    color: #fff;
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100dvh;
    height: 100vh; /* fallback */
}

/* Remove grain overlay from base.css */
body.shorts-body::before {
    display: none;
}

/* --- Fixed persistent player ------------------------------- */

.shorts-player-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
}

.shorts-player-fixed iframe {
    width: 100%;
    height: 100%;
    border: none;
}

@media (min-width: 992px) {
    .shorts-player-fixed {
        left: 50%;
        right: auto;
        width: 420px;
        transform: translateX(-50%);
    }
}

/* --- Feed container ---------------------------------------- */

.shorts-container {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100dvh;
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Desktop: phone-width centered */
@media (min-width: 992px) {
    .shorts-container {
        max-width: 420px;
        margin: 0 auto;
    }
}

/* --- Individual panel -------------------------------------- */

.shorts-panel {
    position: relative;
    width: 100%;
    height: 100dvh;
    height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    overflow: hidden;
    background: #000;
}

/* Blurred thumbnail background */
.shorts-panel-bg {
    position: absolute;
    inset: -20px;
    background-size: cover;
    background-position: center;
    filter: blur(20px) brightness(0.3);
    z-index: 0;
}

/* Loading spinner */
.shorts-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.shorts-spinner-ring {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: #fff;
    border-radius: 50%;
    animation: shortsSpinnerRotate 0.8s linear infinite;
}

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

/* Video visible: hide spinner + thumbnail, reveal fixed iframe behind */
.shorts-panel.video-visible {
    background: transparent;
}

.shorts-panel.video-visible .shorts-panel-bg {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.shorts-panel.video-visible .shorts-spinner {
    display: none;
}

/* --- Bottom overlay ---------------------------------------- */

.shorts-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 60px; /* leave room for action column */
    z-index: 5;
    padding: var(--space-lg);
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85) 40%);
    pointer-events: none;
}

/* Desktop: no tab bar, less bottom padding */
@media (min-width: 992px) {
    .shorts-overlay {
        padding-bottom: var(--space-xl);
    }
}

.shorts-overlay .credibility-badge {
    pointer-events: auto;
    margin-bottom: var(--space-sm);
    font-size: 0.65rem;
}

.shorts-channel {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0 0 var(--space-xs);
}

.shorts-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 500;
    color: #fff;
    line-height: 1.3;
    margin: 0 0 var(--space-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shorts-tldr {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Right-side action column ------------------------------ */

.shorts-actions {
    position: absolute;
    right: 0;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
}

@media (min-width: 992px) {
    .shorts-actions {
        bottom: var(--space-xl);
    }
}

.shorts-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.shorts-action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* Score pill override */
.shorts-score-pill {
    width: auto;
    height: auto;
    border-radius: 0;
    padding: 0.35rem 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.shorts-score-value {
    font-family: var(--font-mono);
}

/* Bookmark states */
.shorts-bookmark-btn.bookmarked {
    background: var(--accent);
    color: #fff;
}

.shorts-bookmark-btn.bookmarked:hover {
    background: var(--accent-hover);
}

/* --- Top bar ----------------------------------------------- */

.shorts-top-bar {
    position: fixed;
    top: env(safe-area-inset-top, 0px);
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    pointer-events: none;
}

/* Desktop: constrain to phone width */
@media (min-width: 992px) {
    .shorts-top-bar {
        max-width: 420px;
        left: 50%;
        transform: translateX(-50%);
    }
}

.shorts-top-btn {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.15rem;
    transition: background 0.2s ease;
    text-decoration: none;
}

.shorts-top-btn:hover {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
}

/* --- Dark tab bar ------------------------------------------ */

.shorts-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: var(--space-sm) 0 calc(var(--space-sm) + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

@media (min-width: 992px) {
    .shorts-tab-bar {
        display: none !important;
    }
}

.shorts-tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 0;
    padding: var(--space-xs) 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: color 0.2s ease;
}

.shorts-tab-item i {
    font-size: 1.25rem;
}

.shorts-tab-item:hover,
.shorts-tab-item.active {
    color: #fff;
}

/* --- Empty state ------------------------------------------- */

.shorts-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100dvh;
    height: 100vh;
    text-align: center;
    padding: var(--space-xl);
    color: rgba(255, 255, 255, 0.7);
}

.shorts-empty i {
    font-size: 3rem;
    margin-bottom: var(--space-lg);
    color: rgba(255, 255, 255, 0.3);
}

.shorts-empty h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: var(--space-sm);
}

.shorts-empty p {
    font-size: 0.95rem;
    margin-bottom: var(--space-lg);
    max-width: 300px;
}

.shorts-empty .btn-primary {
    background: #fff;
    color: #000 !important;
}

.shorts-empty .btn-primary:hover {
    background: var(--accent);
    color: #fff !important;
}

/* --- Hide d-lg-none utility (used on tab bar) -------------- */
/* Bootstrap's d-lg-none is loaded from CDN in base but NOT in
   shorts_feed.html (standalone), so replicate the rule here. */
@media (min-width: 992px) {
    .d-lg-none {
        display: none !important;
    }
}
