/* ============================================
   Arabic Cartoon Player - Light Blue Theme
   ============================================ */

* {
    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;
    -ms-user-select: none;
    user-select: none;
    overflow-x: hidden;
}

a { color: #0a3a5c; text-decoration: none; }

/* ===== Header band ===== */
.top-band {
    width: 100%;
    background: linear-gradient(180deg, #b5dcf3, #8fc3e3);
    border-bottom: 4px double #1a5680;
    text-align: center;
    padding: 10px 0;
    position: relative;
}
.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; }

/* ===== Main outer frame (red border in mock) ===== */
.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);
}

/* Layout: left index column + right player column */
.layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 12px;
}

/* ===== LEFT INDEX (green box in mock) ===== */
.cartoon-index {
    border: 3px solid #2e8b3a;
    border-radius: 10px;
    background: #f5fbff;
    padding: 10px;
    max-height: 720px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #1a5680 #cfe9ff;
}
.cartoon-index::-webkit-scrollbar { width: 10px; }
.cartoon-index::-webkit-scrollbar-track { background: #cfe9ff; border-radius: 6px; }
.cartoon-index::-webkit-scrollbar-thumb { background: #1a5680; border-radius: 6px; }

.cartoon-index h3 {
    text-align: center;
    background: #1a5680;
    color: #fff;
    padding: 6px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.cartoon-card {
    display: block;
    background: #fff;
    border: 1px solid #9ec9e3;
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 6px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.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: 110px;
    object-fit: cover;
    border-radius: 6px;
    pointer-events: none;
}
.cartoon-card .card-title {
    display: block;
    margin-top: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #0a3a5c;
    line-height: 1.2;
}

/* ===== RIGHT SIDE: player + episode grid ===== */
.right-pane {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Video stage */
.video-stage {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}
.video-stage video {
    width: 100%;
    height: 460px;
    background: #000;
    display: block;
    outline: none;
}
.video-stage video::-internal-media-controls-download-button {
    display: none;
}
.video-stage video::-webkit-media-controls-enclosure {
    overflow: hidden;
}
.video-stage video::-webkit-media-controls-panel {
    width: calc(100% + 30px);
}

/* Anti-cast / overlay to block long-press save on mobile */
.video-stage .anti-grab {
    position: absolute;
    inset: 0;
    background: transparent;
    pointer-events: none;
}

.now-playing {
    background: #1a5680;
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    font-size: 0.95rem;
}

/* ===== Episode grid (blue box in mock) ===== */
.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: 1rem;
}
.episode-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    padding: 4px;
    scrollbar-width: thin;
    scrollbar-color: #1f4dbb #cfe9ff;
}
.episode-grid::-webkit-scrollbar { width: 10px; }
.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: 10px 4px;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.15;
}
.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;
}

/* Responsive tweaks */
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .cartoon-index { max-height: 280px; }
    .episode-grid { grid-template-columns: repeat(4, 1fr); }
    .video-stage video { height: 280px; }
}

/* Hide status bar / link previews tricks
   The CSS can't truly hide browser status bar, but we ensure that
   hovering links doesn't create stable URLs to read. JS handles the rest. */
a, .cartoon-card, .ep-btn { -webkit-touch-callout: none; }
