/*
 * TV modu (html.tv-mode): yalnızca TV tarayıcısında ya da kullanıcı elle açtığında geçerlidir.
 * Kumandayla gezinirken seçili öğe belirgin olsun, yazılar ve kartlar uzaktan okunabilsin.
 */

/* Header'daki düğme: TV modu açıkken "Normal view" (geri dönmek için), TV algılanıp mod kapalıyken "TV view" */
.header__tv-toggle {
    display: none !important;
}

html.tv-mode .header__tv-toggle,
html.tv-detected .header__tv-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    width: auto !important;
    padding: 0 12px !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 700;
    white-space: nowrap;
}

html.tv-mode .header__tv-toggle {
    background: rgba(229, 9, 20, 0.85) !important;
    color: #fff !important;
}

/* TV algılanınca bir kereye mahsus öneri (sayfanın altında) */
.tv-offer {
    position: fixed;
    right: 24px;
    bottom: 24px;
    left: 24px;
    z-index: 30000;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px 22px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    background: rgb(24, 25, 31);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 18px;
    line-height: 1.5;
}

.tv-offer__text {
    display: flex;
    flex: 1 1 420px;
    align-items: flex-start;
    gap: 14px;
}

.tv-offer__text i {
    margin-top: 4px;
    color: #e50914;
    font-size: 22px;
}

.tv-offer__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tv-offer__actions button {
    min-height: 50px;
    padding: 0 22px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    background: transparent;
    color: #fff;
    font-family: inherit;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
}

.tv-offer__actions .tv-offer__yes {
    border-color: #e50914;
    background: #e50914;
}

.tv-offer__actions button:focus {
    outline: 4px solid #fff;
    outline-offset: 3px;
}

/* Algılanmayan TV'ler için footer'daki "TV view" bağlantısı; telefonda gereksiz */
@media (max-width: 899px) {
    .footer__tv-link {
        display: none !important;
    }
}

/* ---------- Seçili öğe (kumanda odağı) ---------- */
html.tv-mode a:focus,
html.tv-mode button:focus,
html.tv-mode input:focus,
html.tv-mode select:focus,
html.tv-mode textarea:focus,
html.tv-mode [tabindex]:focus {
    outline: 4px solid #fff !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 9px rgba(229, 9, 20, 0.75) !important;
}

/* Kartta kapak seçilir; çerçeve kartın tamamına verilir */
html.tv-mode .media-card__cover:focus {
    outline: none !important;
    box-shadow: none !important;
}

html.tv-mode .media-card:focus-within {
    border-color: #fff;
    transform: scale(1.05);
    box-shadow: 0 0 0 4px #fff, 0 0 0 10px rgba(229, 9, 20, 0.75), 0 20px 44px rgba(0, 0, 0, 0.6);
}

html.tv-mode .media-card:focus-within .media-card__cover img {
    transform: scale(1.04);
}

html.tv-mode .media-card:focus-within .media-card__play {
    opacity: 1;
    transform: scale(1);
}

/* Kart seçildiğinde büyüyünce carousel kenarında kesilmesin */
html.tv-mode .owl-carousel .owl-stage-outer {
    padding: 14px 0;
    margin: -14px 0;
}

/* Oynatıcı seçiliyken */
html.tv-mode #player:focus {
    outline: 5px solid #fff !important;
    outline-offset: 4px !important;
}

/* ---------- Uzaktan okunabilir yazılar ---------- */
html.tv-mode body {
    font-size: 19px;
}

html.tv-mode p {
    font-size: 19px;
    line-height: 1.6;
}

html.tv-mode .header__nav-link {
    font-size: 19px !important;
}

html.tv-mode .header__sign-in,
html.tv-mode .header__auth-btn {
    font-size: 17px !important;
}

html.tv-mode .section__title {
    font-size: 34px !important;
}

html.tv-mode .media-card__title {
    font-size: 22px;
}

html.tv-mode .media-card__meta {
    font-size: 17px;
}

html.tv-mode .media-card__watch,
html.tv-mode .media-card__toggle {
    min-height: 50px;
    font-size: 18px;
}

html.tv-mode .media-card__badge {
    font-size: 15px;
}

html.tv-mode .watch_chip {
    min-height: 52px;
    font-size: 18px !important;
}

/* ---------- Daha az ama daha büyük kart ---------- */
html.tv-mode .media-grid {
    --media-columns: 3;
}

@media (min-width: 1200px) {
    html.tv-mode .media-grid {
        --media-columns: 4;
    }
}

@media (min-width: 2400px) {
    html.tv-mode .media-grid {
        --media-columns: 5;
    }
}

/* Oynatıcının altındaki kumanda ipucu */
.tv-player-hint {
    display: none;
}

html.tv-mode .tv-player-hint {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 26px;
    margin: 14px 0 6px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
}

html.tv-mode .tv-player-hint kbd {
    display: inline-block;
    min-width: 34px;
    margin-right: 6px;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
}
