/* ============================================================
   VIDEO PLAYER CSS — Ponnuri Gopie Krishna
   Used on both /videos (browse) and /videos/watch/{slug} (watch page)
   ============================================================ */

:root {
    --vp-bg:         #0a1520;
    --vp-card:       #0f2233;
    --vp-card-hover: #133048;
    --vp-border:     rgba(173, 122, 50, 0.4);
    --vp-gold:       #FFD200;
    --vp-gold-soft:  #FFA240;
    --vp-text:       #e9ecef;
    --vp-text-dim:   #b8d4e8;
    --vp-text-muted: #8b9aa6;
    --vp-accent:     linear-gradient(135deg, #E6501B, #BE5103);
    --vp-radius:     12px;
}

/* ============================================================
   BROWSE PAGE (/videos)
   ============================================================ */

.vh-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 16px 60px;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

.vh-header {
    text-align: center;
    margin-bottom: 32px;
    padding: 40px 20px 24px;
    background: radial-gradient(circle at 50% 0%, #103049, transparent 70%);
    border-radius: var(--vp-radius);
}
.vh-header h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 900;
    color: var(--vp-gold);
    margin: 0 0 10px;
    letter-spacing: -0.5px;
}
.vh-header h1 i { margin-right: 10px; }
.vh-header p { color: var(--vp-text-dim); font-size: 1.05rem; margin: 0 0 22px; }

.vh-search {
    display: flex;
    max-width: 560px;
    margin: 0 auto;
    background: var(--vp-card);
    border: 1px solid var(--vp-border);
    border-radius: 999px;
    overflow: hidden;
    padding: 4px;
}
.vh-search i {
    align-self: center;
    padding: 0 8px 0 18px;
    color: var(--vp-gold);
    font-size: 1rem;
}
.vh-search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--vp-text);
    padding: 12px 8px;
    font-size: 0.95rem;
}
.vh-search input::placeholder { color: var(--vp-text-muted); }
.vh-search button {
    background: var(--vp-accent);
    color: #fff;
    border: 2px solid var(--vp-gold);
    padding: 10px 22px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.vh-search button:hover { transform: scale(1.03); }

/* ----- Category pills ----- */
.vh-cats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 32px;
    padding: 6px 0;
}
.vh-cat {
    padding: 9px 18px;
    border-radius: 999px;
    background: var(--vp-card);
    border: 1px solid var(--vp-border);
    color: var(--vp-text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.vh-cat:hover {
    background: var(--vp-card-hover);
    border-color: var(--vp-gold);
    color: var(--vp-gold);
}
.vh-cat.active {
    background: var(--vp-gold);
    color: #0a1928;
    border-color: var(--vp-gold);
}
.vh-cat span {
    background: rgba(255,255,255,0.15);
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
}
.vh-cat.active span { background: rgba(0,0,0,0.15); }

/* ----- Featured row ----- */
.vh-featured { margin-bottom: 40px; }
.vh-featured h2 {
    color: var(--vp-gold);
    font-size: 1.3rem;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.vh-featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}
.vh-featured-card {
    background: var(--vp-card);
    border: 1px solid var(--vp-border);
    border-radius: var(--vp-radius);
    overflow: hidden;
    text-decoration: none;
    transition: all 0.25s;
    position: relative;
}
.vh-featured-card:hover {
    transform: translateY(-4px);
    border-color: var(--vp-gold);
    box-shadow: 0 14px 40px rgba(255,210,0,0.15);
}
.vh-featured-thumb {
    position: relative;
    aspect-ratio: 16/9;
    background: #05101a;
    overflow: hidden;
}
.vh-featured-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}
.vh-featured-card:hover .vh-featured-thumb img { transform: scale(1.05); }
.vh-featured-body { padding: 14px 16px; }
.vh-featured-body h3 {
    color: var(--vp-text);
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 6px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.vh-featured-meta { color: var(--vp-text-muted); font-size: 0.78rem; }

/* ----- Section title ----- */
.vh-section-title {
    color: var(--vp-gold);
    font-size: 1.3rem;
    margin: 0 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.vh-count {
    font-size: 0.85rem;
    color: var(--vp-text-muted);
    font-weight: 500;
}

/* ----- Video grid ----- */
.vh-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}
.vh-card {
    background: var(--vp-card);
    border: 1px solid var(--vp-border);
    border-radius: var(--vp-radius);
    overflow: hidden;
    text-decoration: none;
    transition: all 0.22s;
    display: flex;
    flex-direction: column;
}
.vh-card:hover {
    transform: translateY(-4px);
    border-color: var(--vp-gold);
    box-shadow: 0 14px 40px rgba(255,210,0,0.12);
}
.vh-thumb {
    position: relative;
    background: #05101a;
    overflow: hidden;
}
.vh-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}
.vh-card:hover .vh-thumb img { transform: scale(1.06); }
.vh-no-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #AD7A32;
    font-size: 2.4rem;
}
.vh-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 58px;
    height: 58px;
    background: rgba(230, 80, 27, 0.9);
    border: 2px solid var(--vp-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    opacity: 0;
    transition: all 0.25s;
    pointer-events: none;
}
.vh-play-icon.small { width: 48px; height: 48px; font-size: 1rem; }
.vh-card:hover .vh-play-icon,
.vh-featured-card:hover .vh-play-icon { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
.vh-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    font-size: 0.72rem;
    padding: 3px 7px;
    border-radius: 4px;
    font-weight: 600;
}
.vh-short-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #E6501B, #BE5103);
    border: 1px solid var(--vp-gold);
    color: #fff;
    font-size: 0.68rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.vh-info { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; }
.vh-info h3 {
    color: var(--vp-text);
    font-size: 0.92rem;
    font-weight: 700;
    margin: 0 0 6px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.vh-meta { color: var(--vp-text-muted); font-size: 0.74rem; margin-top: auto; }

.vh-empty {
    text-align: center;
    padding: 70px 20px;
    color: var(--vp-text-muted);
}
.vh-empty i { font-size: 3.5rem; color: #AD7A32; margin-bottom: 16px; display: block; }
.vh-empty h3 { color: var(--vp-gold); margin: 0 0 8px; }

/* ----- Pagination ----- */
.vh-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 36px;
    flex-wrap: wrap;
}
.vh-page-link {
    padding: 8px 14px;
    background: var(--vp-card);
    border: 1px solid var(--vp-border);
    color: var(--vp-text);
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}
.vh-page-link:hover {
    border-color: var(--vp-gold);
    color: var(--vp-gold);
}
.vh-page-link.active {
    background: var(--vp-gold);
    color: #0a1928;
    border-color: var(--vp-gold);
}

/* ============================================================
   WATCH PAGE (/videos/watch/{slug})
   ============================================================ */

.vp-watch-page {
    max-width: 1500px;
    margin: 0 auto;
    padding: 16px 16px 60px;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    color: var(--vp-text);
}

.vp-breadcrumb {
    font-size: 0.82rem;
    color: var(--vp-text-muted);
    padding: 8px 0 16px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.vp-breadcrumb a { color: var(--vp-gold); text-decoration: none; }
.vp-breadcrumb a:hover { text-decoration: underline; }
.vp-breadcrumb i { font-size: 0.65rem; opacity: 0.6; }
.vp-breadcrumb span { color: var(--vp-text-dim); }

.vp-watch-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 24px;
}

.vp-player-column { min-width: 0; }

/* ----- Player shell ----- */
.vp-player-shell {
    background: #05101a;
    border: 1px solid var(--vp-border);
    border-radius: var(--vp-radius);
    overflow: hidden;
    margin-bottom: 20px;
}
.vp-layout-bar {
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    background: #0a1928;
    border-bottom: 1px solid var(--vp-border);
    flex-wrap: wrap;
}
.vp-layout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--vp-text-dim);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.15s;
}
.vp-layout-btn:hover { color: var(--vp-gold); border-color: var(--vp-gold); }
.vp-layout-btn.active {
    background: var(--vp-gold);
    color: #0a1928;
    border-color: var(--vp-gold);
}

.vp-stage {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    min-height: 200px;
}
.vp-frame {
    width: 100%;
    position: relative;
    transition: transform 0.3s ease;
    background: #000;
}
.vp-frame video,
.vp-frame iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ----- Info block ----- */
.vp-info {
    background: var(--vp-card);
    border: 1px solid var(--vp-border);
    border-radius: var(--vp-radius);
    padding: 20px;
}
.vp-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.2rem, 2.5vw, 1.7rem);
    color: var(--vp-gold);
    margin: 0 0 12px;
    line-height: 1.35;
    font-weight: 700;
}
.vp-stats {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    color: var(--vp-text-muted);
    font-size: 0.85rem;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(173,122,50,0.2);
    margin-bottom: 16px;
}
.vp-stats i { color: var(--vp-gold-soft); }

.vp-actions-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.vp-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: var(--vp-bg);
    border: 1px solid var(--vp-border);
    color: var(--vp-text);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.18s;
}
.vp-action:hover {
    background: var(--vp-gold);
    color: #0a1928;
    border-color: var(--vp-gold);
}

.vp-description {
    background: var(--vp-bg);
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--vp-text-dim);
    margin-bottom: 14px;
    max-height: 320px;
    overflow-y: auto;
}
.vp-desc-inner { word-wrap: break-word; }

.vp-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.vp-tag {
    color: var(--vp-gold);
    background: rgba(255,210,0,0.08);
    border: 1px solid rgba(255,210,0,0.25);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    text-decoration: none;
    transition: all 0.15s;
}
.vp-tag:hover {
    background: var(--vp-gold);
    color: #0a1928;
}

/* ----- Related column ----- */
.vp-related-column { min-width: 0; }
.vp-related-title {
    color: var(--vp-gold);
    font-size: 1.05rem;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--vp-border);
    display: flex;
    align-items: center;
    gap: 8px;
}
.vp-related-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 90vh;
    overflow-y: auto;
    padding-right: 4px;
}
.vp-related-card {
    display: flex;
    gap: 10px;
    background: var(--vp-card);
    border: 1px solid var(--vp-border);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.18s;
    padding: 6px;
}
.vp-related-card:hover {
    border-color: var(--vp-gold);
    background: var(--vp-card-hover);
    transform: translateX(3px);
}
.vp-related-thumb {
    position: relative;
    flex-shrink: 0;
    width: 140px;
    aspect-ratio: 16/9;
    background: #05101a;
    border-radius: 6px;
    overflow: hidden;
}
.vp-related-card.is-short .vp-related-thumb { aspect-ratio: 9/16; width: 90px; }
.vp-related-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vp-related-no-thumb { display: flex; align-items: center; justify-content: center; height: 100%; color: #AD7A32; font-size: 1.5rem; }
.vp-related-duration {
    position: absolute; bottom: 4px; right: 4px;
    background: rgba(0,0,0,0.8); color: #fff;
    font-size: 0.68rem; padding: 2px 5px; border-radius: 3px;
}
.vp-short-badge {
    position: absolute; top: 4px; left: 4px;
    background: var(--vp-gold); color: #0a1928;
    font-size: 0.6rem; padding: 2px 5px; border-radius: 3px;
}
.vp-related-info { min-width: 0; display: flex; flex-direction: column; justify-content: center; flex: 1; }
.vp-related-name {
    color: var(--vp-text);
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.vp-related-meta { color: var(--vp-text-muted); font-size: 0.72rem; }

/* ============================================================
   LAYOUT MODES
   ============================================================ */

/* WIDE — pushes related column below, full width player */
body.vp-layout-wide .vp-watch-layout {
    grid-template-columns: 1fr;
}
body.vp-layout-wide .vp-related-column { display: block; }
body.vp-layout-wide .vp-related-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    max-height: none;
    gap: 12px;
}
body.vp-layout-wide .vp-related-card {
    flex-direction: column;
    padding: 8px;
}
body.vp-layout-wide .vp-related-thumb {
    width: 100%;
}

/* THEATER — dim page, player takes focus, related below */
body.vp-layout-theater .vp-player-shell {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9000;
    background: #000;
    border-radius: 0;
    border: none;
    padding-top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}
body.vp-layout-theater .vp-layout-bar {
    position: relative;
    z-index: 9001;
    background: rgba(10,25,40,0.95);
}
body.vp-layout-theater .vp-stage {
    flex: 1;
    min-height: 0;
}
body.vp-layout-theater .vp-frame {
    max-width: 100%;
    max-height: 100%;
    margin: auto;
}
body.vp-layout-theater .vp-info,
body.vp-layout-theater .vp-related-column {
    display: none;
}

/* FULLSCREEN — native fullscreen will be requested */
body.vp-layout-fullscreen .vp-player-shell {
    background: #000;
    border: none;
    border-radius: 0;
}

/* Overlay */
.vp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 8000;
    display: none;
}

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */

@media (max-width: 991.98px) {
    .vp-watch-layout { grid-template-columns: 1fr; }
    .vp-related-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        max-height: none;
    }
    .vp-related-card { flex-direction: column; }
    .vp-related-thumb { width: 100%; }
}

@media (max-width: 640px) {
    .vh-page { padding: 12px 12px 40px; }
    .vh-header { padding: 28px 12px 18px; }
    .vh-header h1 { font-size: 1.5rem; }
    .vh-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .vh-info { padding: 10px 10px 12px; }
    .vh-info h3 { font-size: 0.82rem; }
    .vh-cats { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 8px; }
    .vh-cat { flex-shrink: 0; }

    .vp-watch-page { padding: 8px 8px 40px; }
    .vp-layout-bar { padding: 6px; gap: 4px; }
    .vp-layout-btn span { display: none; }
    .vp-layout-btn { padding: 8px 10px; }
    .vp-info { padding: 14px; }
    .vp-title { font-size: 1.15rem; }
    .vp-stats { font-size: 0.78rem; gap: 12px; }
    .vp-action { padding: 8px 12px; font-size: 0.75rem; }
    .vp-action i { font-size: 0.85rem; }
    .vp-related-list {
        display: grid;
        grid-template-columns: 1fr;
    }
    .vp-related-card { flex-direction: row; }
    .vp-related-thumb { width: 110px; }
}

/* Shorts (vertical) — narrower column when in normal mode */
.vp-player-shell[data-is-short="1"] .vp-frame {
    max-width: 420px;
    margin: 0 auto;
}
@media (max-width: 640px) {
    .vp-player-shell[data-is-short="1"] .vp-frame { max-width: 100%; }
}

/* Rotate mode for landscape videos on phones */
body.vp-layout-theater .vp-frame[style*="rotate(90deg)"] {
    transform: rotate(90deg) !important;
    width: 100vh !important;
    height: 100vw !important;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -50vw;
    margin-left: -50vh;
}

/* ============================================================
   SCROLLBARS
   ============================================================ */
.vp-related-list::-webkit-scrollbar,
.vp-description::-webkit-scrollbar { width: 6px; }
.vp-related-list::-webkit-scrollbar-track,
.vp-description::-webkit-scrollbar-track { background: #05101a; border-radius: 3px; }
.vp-related-list::-webkit-scrollbar-thumb,
.vp-description::-webkit-scrollbar-thumb { background: #AD7A32; border-radius: 3px; }
.vp-related-list::-webkit-scrollbar-thumb:hover,
.vp-description::-webkit-scrollbar-thumb:hover { background: var(--vp-gold); }

/* ============================================================
   FULLSCREEN NATIVE
   ============================================================ */
.vp-player-shell:fullscreen { width: 100vw; height: 100vh; border-radius: 0; }
.vp-player-shell:fullscreen .vp-stage { height: calc(100vh - 50px); }
.vp-player-shell:fullscreen .vp-frame {
    height: 100%;
    max-width: 100%;
    max-height: 100%;
}