/* ============================================
   Video Player - Style (Blue Theme matching Image 1)
   ============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    background: linear-gradient(135deg, #cfe9ff 0%, #a8d8f0 50%, #7fc2e8 100%);
    color: #0a3a5c;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    overflow-x: hidden;
}

a { color: #0a3a5c; text-decoration: none; }

/* ===== TOP HEADER BAND (Assyrian4all / Chaldean4all) ===== */
.top-band {
    width: 100%;
    background: linear-gradient(180deg, #b5dcf3, #8fc3e3);
    border-bottom: 4px double #1a5680;
    text-align: center;
    padding: 10px 0;
}
.top-band .title-pill {
    display: inline-block;
    padding: 6px 26px;
    background: #fff;
    border: 2px solid #1a5680;
    border-radius: 18px;
    font-weight: 700;
    color: #0a3a5c;
    font-size: 1.05rem;
    letter-spacing: 1px;
    box-shadow: 0 2px 6px rgba(10,58,92,0.18);
}
.top-band .title-pill span { margin: 0 24px; }

/* ===== OUTER RED FRAME ===== */
.outer-frame {
    margin: 14px auto;
    width: 96%;
    max-width: 1400px;
    border: 3px solid #d33;
    border-radius: 12px;
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(2px);
    padding: 12px;
    box-shadow: 0 10px 30px rgba(10,58,92,0.18);
}

/* ===== MAIN LAYOUT: green index left + player right ===== */
.layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 12px;
}

/* ===== LEFT INDEX (green border, scrollable) ===== */
.cartoon-index {
    border: 3px solid #2e8b3a;
    border-radius: 10px;
    background: #f5fbff;
    padding: 8px;
    max-height: 760px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #1a5680 #cfe9ff;
}
.cartoon-index::-webkit-scrollbar { width: 8px; }
.cartoon-index::-webkit-scrollbar-track { background: #cfe9ff; border-radius: 6px; }
.cartoon-index::-webkit-scrollbar-thumb { background: #1a5680; border-radius: 6px; }

.cartoon-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #9ec9e3;
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 16px 10px;
    text-align: center;
    cursor: pointer;
    min-height: 70px;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.cartoon-card:hover {
    transform: translateY(-2px);
    border-color: #1a5680;
    box-shadow: 0 4px 10px rgba(26,86,128,0.25);
}
.cartoon-card.active {
    border-color: #d33;
    background: #fff5f5;
}
.cartoon-card img {
    width: 100%;
    max-height: 120px;
    object-fit: cover;
    border-radius: 6px;
    pointer-events: none;
    display: block;
    margin-bottom: 8px;
}
.cartoon-card img[style*="visibility:hidden"],
.cartoon-card img[style*="visibility: hidden"] {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
}
.cartoon-card .card-title {
    display: block;
    margin-top: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a5680;
    line-height: 1.4;
    word-break: break-word;
}

/* ===== RIGHT PANE ===== */
.right-pane {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

/* Now-playing status bar */
.now-playing {
    background: #1a5680;
    color: #fff;
    padding: 10px 14px;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    font-size: 1.2rem;
}

/* ===== jPlayer overrides ===== */
.player-host {
    background: #000;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

#jp_container_1.jp-video {
    width: 100%;
    max-width: 100%;
    border: none !important;
    background: transparent !important;
    position: relative;
}
#jp_container_1.jp-video-360p:not(.jp-state-full-screen) { width: 100% !important; }

#jp_container_1:not(.jp-state-full-screen) .jp-jplayer {
    width: 100% !important;
    height: 420px !important;
    background-color: #000 !important;
}
#jp_container_1:not(.jp-state-full-screen) .jp-jplayer video {
    width: 100% !important;
    height: 100% !important;
    display: block;
    object-fit: contain;
    background: #000;
}

/* Big play button overlay */
#jp_container_1:not(.jp-state-full-screen) .jp-video-play {
    position: absolute !important;
    top: 0 !important; left: 0 !important; right: 0 !important;
    width: 100% !important;
    height: 420px !important;
    margin: 0 !important; padding: 0 !important;
    background: transparent !important;
    pointer-events: none;
    z-index: 5;
}
#jp_container_1:not(.jp-state-full-screen) .jp-video-play-icon {
    pointer-events: auto;
    position: absolute !important;
    top: 50% !important; left: 50% !important;
    margin: 0 !important;
    transform: translate(-50%, -50%);
    width: 112px !important; height: 100px !important;
}
.jp-state-playing .jp-video-play,
.jp-state-playing .jp-video-play-icon { display: none !important; }

/* Controls bar */
#jp_container_1:not(.jp-state-full-screen) .jp-interface {
    background-color: #3a2a45 !important;
    border-color: #180a1f !important;
    color: #fff;
    position: relative !important;
    width: 100% !important;
    min-height: 80px;
    padding-bottom: 8px;
}
#jp_container_1:not(.jp-state-full-screen) .jp-progress {
    width: 100% !important; height: 13px !important; margin: 0 !important;
}
.jp-current-time, .jp-duration {
    color: #8c7a99 !important; font-size: 0.75rem !important; padding-top: 4px !important;
}
.jp-video .jp-current-time { padding-left: 12px !important; }
.jp-video .jp-duration    { padding-right: 12px !important; }

#jp_container_1:not(.jp-state-full-screen) .jp-controls-holder {
    clear: both; width: auto !important; margin: 8px auto !important;
    display: flex !important; justify-content: center; align-items: center;
    gap: 14px; flex-wrap: wrap; position: relative !important;
}
#jp_container_1:not(.jp-state-full-screen) .jp-controls {
    margin: 0 !important; float: none !important; display: inline-flex !important;
}
#jp_container_1:not(.jp-state-full-screen) .jp-toggles {
    margin: 0 !important; float: none !important; display: inline-flex !important; width: auto !important;
}
#jp_container_1:not(.jp-state-full-screen) .jp-volume-controls {
    position: relative !important; display: inline-flex !important;
    align-items: center; width: 130px; height: 30px;
}
#jp_container_1:not(.jp-state-full-screen) .jp-volume-bar {
    position: relative !important; top: 0 !important;
    margin: 0 4px !important; width: 80px !important; border-right: none !important;
}

/* Fullscreen */
#jp_container_1.jp-state-full-screen {
    position: fixed !important; top: 0 !important; left: 0 !important;
    width: 100vw !important; height: 100vh !important;
    max-width: none !important; background: #000 !important; z-index: 99999 !important;
}
#jp_container_1.jp-state-full-screen .jp-jplayer {
    position: fixed !important; top: 0 !important; left: 0 !important;
    width: 100vw !important; height: 100vh !important;
    z-index: 99999 !important; background: #000 !important;
}
#jp_container_1.jp-state-full-screen .jp-jplayer video {
    width: 100vw !important; height: 100vh !important;
    object-fit: contain !important; background: #000 !important;
}
#jp_container_1.jp-state-full-screen .jp-gui {
    position: fixed !important; inset: 0; z-index: 100000 !important;
}
#jp_container_1.jp-state-full-screen .jp-interface {
    position: absolute !important; bottom: 0 !important; left: 0 !important; right: 0 !important;
    width: 100% !important; background-color: rgba(58,42,69,0.85) !important;
    z-index: 100001 !important;
}
#jp_container_1.jp-state-full-screen .jp-video-play {
    position: absolute !important; inset: 0; pointer-events: none; z-index: 100000 !important;
}
#jp_container_1.jp-state-full-screen .jp-video-play-icon {
    pointer-events: auto; position: absolute !important;
    top: 50% !important; left: 50% !important;
    margin: 0 !important; transform: translate(-50%, -50%);
}

/* Hide jPlayer's own playlist UI (we build our own grid) */
.jp-playlist { display: none !important; }
.jp-title    { display: none !important; }
.jp-details  { display: none !important; }

/* ===== EPISODE GRID (blue border, scrollable, stays visible) ===== */
.episode-grid-wrap {
    border: 3px solid #1f4dbb;
    border-radius: 10px;
    background: #eaf3fc;
    padding: 10px;
}
.episode-grid-wrap h3 {
    text-align: center;
    color: #1f4dbb;
    margin-bottom: 8px;
    font-size: 1.3rem;
}
.episode-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
    padding: 4px;
    scrollbar-width: thin;
    scrollbar-color: #1f4dbb #cfe9ff;
}
.episode-grid::-webkit-scrollbar { width: 8px; }
.episode-grid::-webkit-scrollbar-track { background: #cfe9ff; border-radius: 6px; }
.episode-grid::-webkit-scrollbar-thumb { background: #1f4dbb; border-radius: 6px; }

.ep-btn {
    background: linear-gradient(180deg, #3a3a55, #1f1f33);
    color: #fff;
    border: 2px solid #1f4dbb;
    border-radius: 6px;
    padding: 12px 10px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.3;
    /* CRITICAL: hide URL in status bar */
    -webkit-touch-callout: none;
}
.ep-btn:hover {
    background: linear-gradient(180deg, #1f4dbb, #0d2c70);
    transform: scale(1.04);
}
.ep-btn.active {
    background: linear-gradient(180deg, #d33, #8b1a1a);
    border-color: #fff;
    box-shadow: 0 0 8px rgba(211,51,51,0.7);
}

/* Footer */
.foot {
    text-align: center;
    margin: 14px 0 22px;
    color: #0a3a5c;
    font-size: 0.85rem;
    opacity: 0.85;
}

/* Suppress any URL leaking via CSS content trick */
a, .cartoon-card, .ep-btn, button { -webkit-touch-callout: none; }

/* Responsive */
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .cartoon-index { max-height: 260px; }
    .episode-grid { grid-template-columns: repeat(2, 1fr); }
    #jp_container_1:not(.jp-state-full-screen) .jp-jplayer { height: 260px !important; }
    #jp_container_1:not(.jp-state-full-screen) .jp-video-play { height: 260px !important; }
}
