/* ReporterX TV — Public Player Styles v1.4 */
* { box-sizing: border-box; }

.rx-tv-app {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #0a0f1e;
    color: #e0e0e0;
    margin: 0; padding: 0;
}

/* ====== PLAYER WRAP ====== */
.rx-tv-player-wrap {
    position: relative;
    width: 100%;
    background: #000;
}

/* ====== PLAYER WRAP ====== */
.rx-tv-player-wrap {
    position: relative;
    width: 100%;
    background: #000;
    /* Reset sve što tema može naslijediti */
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    float: none;
    clear: both;
}

/*
 * 16:9 kontejner — dva načina za maksimalnu kompatibilnost:
 * 1. aspect-ratio (moderni browseri — Chrome 88+, Firefox 89+, Safari 15+)
 * 2. padding-bottom fallback za starije (height:0 je OBAVEZNO da tema ne gazi)
 */
.rx-tv-player {
    position: relative;
    width: 100%;
    /* Fallback za starije browsere */
    height: 0;
    padding-bottom: 56.25%;
    background: radial-gradient(ellipse at center, #1a2a4a 0%, #0a0f1e 70%);
    overflow: hidden;
    box-sizing: border-box;
    /* Moderni browseri — overrideuje padding-bottom fallback */
    aspect-ratio: 16 / 9;
}

/* Kad aspect-ratio radi, padding-bottom nije potreban */
@supports (aspect-ratio: 16/9) {
    .rx-tv-player {
        height: auto;
        padding-bottom: 0;
    }
}

/* Svi direktni children zauzimaju ceo player */
.rx-tv-player > * {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

/* ====== SPLASH ====== */
.rx-tv-splash {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, #1a2a4a 0%, #0a0f1e 70%);
    z-index: 10;
}

.rx-splash-logo {
    font-size: clamp(28px, 5vw, 56px);
    font-weight: 700;
    color: #fff;
    letter-spacing: 2px;
    margin-bottom: 10px;
}
.rx-splash-logo span { color: #38bdf8; }

.rx-splash-sub {
    font-size: clamp(9px, 1.5vw, 13px);
    letter-spacing: 8px;
    color: #94a3b8;
    margin-bottom: 32px;
}

.rx-splash-now, .rx-splash-next {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: clamp(11px, 1.5vw, 13px);
    margin-bottom: 6px;
    max-width: 80%;
    text-align: center;
}
.rx-splash-now { color: #f87171; }
.rx-splash-next { color: #64748b; margin-bottom: 18px; }
.rx-splash-now-label {
    background: #e02020; color: #fff;
    font-size: 9px; font-weight: 800;
    padding: 2px 7px; border-radius: 3px;
    letter-spacing: 1px; flex-shrink: 0;
}
.rx-splash-next-label {
    background: #1e2d4a; color: #94a3b8;
    font-size: 9px; font-weight: 700;
    padding: 2px 7px; border-radius: 3px;
    letter-spacing: 1px; flex-shrink: 0;
}

.rx-tv-start-btn {
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    color: #fff; border: none;
    padding: 16px 44px;
    border-radius: 50px;
    font-size: clamp(13px, 2vw, 17px);
    font-weight: 700; cursor: pointer;
    letter-spacing: 2px;
    box-shadow: 0 8px 32px rgba(56,189,248,0.3);
    transition: all 0.2s;
}
.rx-tv-start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(56,189,248,0.5);
}
.rx-splash-hint { margin-top: 12px; font-size: 11px; color: #64748b; }

/* Najava programa na splash */
.rx-splash-now, .rx-splash-next { line-height: 1.4; }

/* ====== ČEKANJE IZMEĐU EMISIJA ====== */
.rx-tv-waiting {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #000;
    z-index: 10;
}
.rx-waiting-logo-img { width: clamp(120px, 20vw, 200px); margin-bottom: 24px; opacity: 0.8; }
.rx-waiting-msg { font-size: clamp(13px, 2vw, 18px); color: #94a3b8; margin-bottom: 12px; }
.rx-waiting-next { font-size: clamp(12px, 1.8vw, 15px); color: #64748b; }
.rx-waiting-next strong { color: #38bdf8; }

/* ====== YOUTUBE IFRAME ====== */
#rx-tv-iframe-wrap { z-index: 5; }
#rx-tv-iframe-wrap iframe { width: 100%; height: 100%; border: none; display: block; }

/* ====== LOGO OVERLAY — gornji desni ====== */
.rx-tv-logo-overlay {
    /* Override .rx-tv-player > * koji postavlja width/height 100% */
    width: auto !important;
    height: auto !important;
    top: 10px !important;
    right: 10px !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 9;
    pointer-events: none;
}
.rx-tv-logo-overlay img {
    display: block;
    width: clamp(90px, 12vw, 150px);
    height: auto;
    opacity: 0.85;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.9));
}

/* ====== KONTROLE OVERLAY — dno playera ====== */
/*
 * KLJUČNO: kontrole su UNUTAR .rx-tv-player (position:absolute children),
 * pa su vidljive i u fullscreen modu jer YT fullscreen ne uzima ceo DOM,
 * već browser fullscreen uzima ceo rx-tv-player element zajedno sa svim childrenima.
 */
.rx-tv-controls-overlay {
    /* Override .rx-tv-player > * */
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: auto !important;
    /* Stil */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
    z-index: 20;
    gap: 12px;
    /* Sakrivanje sa auto-hide */
    opacity: 1;
    transition: opacity 0.3s;
}

.rx-tv-controls-overlay.hidden { display: none; }
.rx-tv-controls-overlay.autohide { opacity: 0; pointer-events: none; }

.rx-tv-controls-left { display: flex; align-items: center; gap: 12px; flex: 1; }
.rx-tv-controls-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Dugmad */
.rx-ctrl-btn {
    background: #e02020;
    color: #fff; border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: clamp(10px, 1.5vw, 13px);
    font-weight: 700; cursor: pointer;
    letter-spacing: 0.5px;
    transition: background 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.rx-ctrl-btn:hover { background: #c01a1a; }
.rx-fs-btn { background: #e02020; }
.rx-fs-btn.is-fullscreen { background: #374151; }

/* Volume slider */
.rx-volume-wrap { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }

.rx-volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    max-width: 120px;
    height: 5px;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    background: linear-gradient(to right,
        #e02020 0%,
        #e02020 var(--slider-fill, 0%),
        #374151 var(--slider-fill, 0%),
        #374151 100%
    );
}
.rx-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px; height: 16px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #e02020;
    box-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.rx-volume-slider::-moz-range-thumb {
    width: 16px; height: 16px;
    background: #fff; border-radius: 50%;
    cursor: pointer; border: 2px solid #e02020;
}
.rx-volume-slider::-moz-range-progress { background: #e02020; border-radius: 3px; }
#rx-volume-label { font-size: 12px; color: #e0e0e0; min-width: 32px; font-variant-numeric: tabular-nums; }

/* ====== AUTO-HIDE KONTROLA (hover da se pokažu) ====== */
.rx-tv-player:hover .rx-tv-controls-overlay:not(.hidden) { opacity: 1; pointer-events: auto; }

/* ====== FULLSCREEN ====== */
/*
 * Pošto su kontrole UNUTAR .rx-tv-player, nema potrebe za kompleksnim
 * fullscreen CSS-om. Browser fullscreen uzima ceo rx-tv-player element.
 * Samo trebamo osigurati da player popuni ceo ekran.
 */
.rx-tv-app:fullscreen         { background: #000; }
.rx-tv-app:-webkit-full-screen { background: #000; }
.rx-tv-app:-moz-full-screen   { background: #000; }

.rx-tv-app:fullscreen .rx-tv-player,
.rx-tv-app:-webkit-full-screen .rx-tv-player,
.rx-tv-app:-moz-full-screen .rx-tv-player {
    padding-bottom: 0;
    height: 100vh;
    width: 100vw;
}

.rx-tv-app:fullscreen .rx-tv-schedule-wrap,
.rx-tv-app:-webkit-full-screen .rx-tv-schedule-wrap,
.rx-tv-app:-moz-full-screen .rx-tv-schedule-wrap {
    display: none;
}

/* ====== SCHEDULE ====== */
.rx-tv-schedule-wrap {
    padding: 20px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.rx-tv-schedule-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #1e2d4a;
    flex-wrap: wrap;
}

.rx-now-playing {
    display: inline-block;
    background: #e02020; color: #fff;
    padding: 5px 14px;
    border-radius: 4px;
    font-size: 13px; font-weight: 600;
    letter-spacing: 1px;
}
.rx-now-playing:empty { display: none; }
.rx-schedule-date-label { font-size: 12px; color: #64748b; }

.rx-tv-schedule-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .rx-tv-schedule-grid { grid-template-columns: 1fr; }
    .rx-tv-schedule-wrap { padding: 16px; }
}

.rx-tv-schedule-half {
    background: #0f1929;
    border: 1px solid #1e2d4a;
    border-radius: 8px;
    overflow: hidden;
}

.rx-schedule-half-title {
    background: #162035;
    padding: 10px 16px;
    font-size: 12px; font-weight: 700;
    color: #64748b; letter-spacing: 1px;
    border-bottom: 1px solid #1e2d4a;
}

.rx-schedule-list-inner { padding: 6px 0; }
.rx-schedule-loading { padding: 16px; font-size: 12px; color: #374151; text-align: center; }

.rx-sched-item {
    display: flex; align-items: center;
    gap: 14px; padding: 10px 16px;
    border-bottom: 1px solid #1a2540;
    transition: background 0.15s;
}
.rx-sched-item:last-child { border-bottom: none; }
.rx-sched-item:hover { background: #162035; }
.rx-sched-item.active {
    background: rgba(224,32,32,0.1);
    border-left: 3px solid #e02020;
}

.rx-sched-time {
    font-size: 15px; font-weight: 700;
    color: #38bdf8; min-width: 48px;
    font-variant-numeric: tabular-nums;
}
.rx-sched-item.active .rx-sched-time { color: #e02020; }
.rx-sched-name { font-size: 13px; color: #cbd5e1; flex: 1; }

.rx-sched-live-dot {
    width: 8px; height: 8px;
    background: #e02020; border-radius: 50%;
    animation: livePulse 1.2s ease-in-out infinite; flex-shrink: 0;
}
@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

.rx-schedule-empty { padding: 20px 16px; font-size: 12px; color: #374151; text-align: center; }

.hidden { display: none !important; }
