/* TONS IPTV - PROFESSIONAL WEB PLAYER STYLE */
html, body {
    /* Sayfanın çekilince zıplamasını ve gereksiz yenileme tetiklenmesini önler */
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Ana taşıyıcının mobilde nasıl davranacağını belirleyelim */
.main-layout {
    display: flex;
    flex-direction: row;
    height: 100vh; /* Masaüstünde tam ekran */
}

@media (max-width: 768px) {
    .main-layout {
        flex-direction: column; /* Mobilde alt alta */
        height: auto; /* İçerik kadar uzasın */
        overflow-y: scroll; /* Kaydırmayı buraya veriyoruz */
        -webkit-overflow-scrolling: touch; /* iOS ve Android akıcılığı için */
    }
    
    .sidebar {
        width: 100%;
        order: 2; /* Listeyi videonun altına koyar */
    }
}
/* 1. GENEL SIFIRLAMA */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 1. Sayfanın genelindeki kısıtlamayı kaldırın */
body {
    background-color: #0f0f0f;
    color: #ffffff;
    font-family: 'Segoe UI', sans-serif;
    overflow-y: auto; /* hidden yerine auto yaptık ki taşma olursa kaysın */
    min-height: 100vh;
}

/* 2. GİRİŞ EKRANI */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #2c3e50 0%, #000000 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.login-box {
    background: rgba(20, 20, 20, 0.95);
    padding: 40px;
    border-radius: 15px;
    width: 380px;
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    border-top: 5px solid #e50914;
}

.logo {
    font-size: 2.5rem;
    font-weight: 900;
    color: #e50914;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.input-group input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 5px;
    border: 1px solid #333;
    background: #1a1a1a;
    color: #fff;
    outline: none;
}

.input-group input:focus {
    border-color: #e50914;
}

#loginBtn {
    width: 100%;
    padding: 12px;
    background: #e50914;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

#loginBtn:hover {
    background: #b20710;
}

/* 3. ÜST BAR (TOP BAR) */
.top-bar {
    height: 60px;
    background: #141414;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    border-bottom: 2px solid #e50914;
}

.brand { font-weight: bold; font-size: 1.2rem; }
.brand span { color: #e50914; font-weight: 900; }
.user-controls { display: flex; align-items: center; gap: 15px; }

/* 4. ANA YERLEŞİM (LAYOUT) */
.main-layout {
    display: flex;
    min-height: calc(100vh - 60px); /* Sabit height yerine min-height */
    width: 100%;
}

/* 5. SIDEBAR (SOL MENÜ) */
.sidebar {
    width: 320px;
    background: #141414;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #222;
    /* Masaüstünde sidebar'ın kendi içinde kayması için: */
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
}

/* Mod Seçici (Canlı/Film/Dizi) */
.mode-selector {
    display: flex;
    gap: 5px;
    padding: 10px;
    background: #181818;
}

.mode-btn {
    flex: 1;
    padding: 10px 5px;
    background: #333;
    border: none;
    color: #fff;
    font-weight: bold;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
}

.mode-btn.active { background: #e50914; }

/* Kategori ve Arama */
.category-wrapper, .search-wrapper {
    padding: 10px 15px;
}

#categorySelect, #searchInput {
    width: 100%;
    padding: 10px;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #fff;
    border-radius: 4px;
    outline: none;
}
#searchInput {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    background: #222;
    border: 1px solid #444;
    color: white;
    border-radius: 5px;
}

#searchInput:focus { border-color: #e50914; }

/* Kanal Listesi (Kaydırılabilir Alan) */
.channel-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.kanal-buton {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 5px;
    background: #1e1e1e;
    color: #fff;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    transition: 0.2s;
}

.kanal-buton:hover {
    background: #333;
    border-color: #e50914;
    transform: translateX(3px);
}

/* 6. OYNATICI ALANI (SAĞ TARAF) */
.player-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #000;
}

/* Şimdi Oynatılıyor Barı */
#now-playing-container {
    background: #0a0a0a;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #222;
}

.now-playing-info .label { color: #666; font-size: 0.7rem; margin-right: 10px; }
#now-playing-title { color: #fff; font-weight: bold; font-size: 1rem; }

/* Canlı Yayını Yanıp Sönen Işık */
#live-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dot {
    width: 10px;
    height: 10px;
    background: #e50914;
    border-radius: 50%;
    animation: blink 1s infinite;
}

.text { color: #e50914; font-size: 0.8rem; font-weight: bold; }

@keyframes blink { 0% {opacity: 1;} 50% {opacity: 0.3;} 100% {opacity: 1;} }

/* Video Konteyner */
.video-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#videoElement {
    width: 100%;
    max-height: 100%;
    background: #000;
}

/* 7. SCROLLBAR ÖZELLEŞTİRME */
.channel-list::-webkit-scrollbar { width: 6px; }
.channel-list::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }
.channel-list::-webkit-scrollbar-thumb:hover { background: #e50914; }

/* 8. MOBİL UYUMLULUK */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column; /* Yan yana olan yapıyı alt alta getirir */
        height: auto;
    }

    .sidebar {
        width: 100%;
        height: auto; /* Mobilde sabit yüksekliği kaldır */
        position: static;
        order: 2; /* Menüyü videonun altına atar */
    }

    .player-area {
        width: 100%;
        height: auto;
        order: 1; /* Videoyu en üste alır */
        padding: 10px;
    }

    .video-container {
        aspect-ratio: 16 / 9; /* Videonun oranını korur */
        margin-bottom: 20px;
    }

    #kanal-buton-alani {
        max-height: 500px; /* Menü çok uzarsa kendi içinde kaysın */
        overflow-y: auto;
    }
}
/* Çıkış Butonu Stili */
.logout-btn {
    background-color: #e50914; /* Netflix kırmızısı */
    color: white !important;   /* Yazı rengini beyaza zorla */
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 1 !important;    /* Solukluğu tamamen kaldırır */
    text-transform: uppercase;
    font-size: 12px;
}

/* Üzerine gelince (Hover) efekti */
.logout-btn:hover {
    background-color: #b20710; /* Biraz daha koyu kırmızı */
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.5);
    transform: scale(1.05);
}
/* Sidebar ve Kategori Kartları Düzenlemesi */
.modern-mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    padding: 15px;
    background: #111;
}

.nav-card {
    background: linear-gradient(180deg, #b31217 0%, #222 60%, #111 100%);
    border-radius: 15px;
    padding: 15px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.05);
    transition: 0.3s;
}

.nav-card i {
    font-size: 24px;
    color: white;
    margin-bottom: 8px;
}

.nav-card span {
    font-size: 11px;
    font-weight: bold;
    color: white;
    letter-spacing: 0.5px;
}

/* Seçili Kart Efekti */
.nav-card.active {
    background: linear-gradient(180deg, #e50914 0%, #333 100%);
    border-color: #ff0a16;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(229, 9, 20, 0.4);
}

/* Giriş Kutusu Düzenlemesi (Önceki sıkışıklığı çözen) */
.login-box {
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-logo {
    width: 220px;
    margin-bottom: 30px; /* Logo ile başlık arası boşluk */
}

.input-group input {
    width: 100%;
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #333;
    background: #222;
    color: white;
}
/* Seçim Ekranı Tasarımı */
#selection-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, #1a1a1a 0%, #000 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.selection-container { text-align: center; }
.selection-logo { width: 200px; margin-bottom: 30px; }
.selection-container h2 { color: white; margin-bottom: 40px; font-weight: 300; }

.card-wrapper {
    display: flex;
    gap: 30px;
    justify-content: center;
}

.big-card {
    width: 220px;
    height: 300px;
    background: linear-gradient(180deg, #b31217 0%, #222 60%, #111 100%);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
}

.big-card i { font-size: 70px; color: white; margin-bottom: 20px; }
.big-card span { color: white; font-size: 1.5rem; font-weight: bold; }

/* Üzerine gelince büyüme ve parlama */
.big-card:hover {
    transform: scale(1.1);
    border-color: #ff0a16;
    box-shadow: 0 0 50px rgba(229, 9, 20, 0.6);
}

/* Mobilde kartların sığması için */
@media (max-width: 768px) {
    .card-wrapper { flex-direction: column; gap: 20px; }
    .big-card { width: 180px; height: 120px; flex-direction: row; gap: 15px; }
    .big-card i { font-size: 30px; margin-bottom: 0; }
}
.category-wrapper {
    margin-top: 20px; /* Butonların boşluğunu telafi eder */
}
.navigation-controls {
    padding: 10px 15px;
    border-bottom: 1px solid #333;
}

.back-nav-btn {
    width: 100%;
    background: #222;
    color: #eee;
    border: 1px solid #444;
    padding: 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.back-nav-btn i {
    color: #e50914; /* TONS TV Kırmızısı */
}

.back-nav-btn:hover {
    background: #e50914;
    color: white;
    border-color: #ff0a16;
}

.back-nav-btn:hover i {
    color: white;
}
/* Ayarlar Paneli Yeni Nesil Tasarım */
#settings-panel {
    background: radial-gradient(circle, #1c1f26 0%, #0a0b0d 100%);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.settings-header {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 Sütun */
    gap: 20px;
    width: 90%;
    max-width: 1100px;
}

.settings-card {
    background: #2a2e38;
    border-radius: 15px;
    padding: 30px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.settings-card:hover {
    background: #363b47;
    transform: translateY(-5px);
    border-color: #e50914;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.settings-card i {
    font-size: 2.5rem;
    color: #e50914; /* TONS Kırmızısı */
    margin-bottom: 15px;
}

.settings-card span {
    color: #cbd2d9;
    font-size: 0.95rem;
    font-weight: bold;
    text-align: center;
}

@media (max-width: 900px) {
    .settings-grid { grid-template-columns: repeat(2, 1fr); }
}
.settings-sub-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex; align-items: center; justify-content: center;
    z-index: 10005;
}

.modal-content {
    background: #1a1a1a;
    padding: 30px;
    border-radius: 20px;
    border: 2px solid #e50914;
    text-align: center;
    width: 320px;
}

.pin-display input {
    width: 150px;
    height: 50px;
    background: #000;
    border: 1px solid #333;
    color: #e50914;
    font-size: 2rem;
    text-align: center;
    margin: 20px 0;
    letter-spacing: 10px;
    border-radius: 10px;
}

.pin-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.pin-pad button {
    padding: 15px;
    font-size: 1.2rem;
    background: #2a2a2a;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
}

.pin-pad button:hover {
    background: #e50914;
}

.close-sub-btn {
    margin-top: 20px;
    background: transparent;
    color: #888;
    border: none;
    cursor: pointer;
}
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: #050505;
}

.login-content {
    text-align: center;
    width: 100%;
    max-width: 800px;
    padding: 20px;
}

.login-logo {
    width: 180px;
    margin-bottom: 20px;
}

.login-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.login-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: 12px;
    width: 180px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-card:hover {
    background: #e50914;
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(229, 9, 20, 0.3);
}

.login-card i { font-size: 32px; color: white; margin-bottom: 15px; }
.login-card h3 { color: white; margin-bottom: 5px; font-size: 18px; }
.login-card p { color: #aaa; font-size: 13px; }
.login-card:hover p { color: white; }

.sub-panel {
    display: none;
    background: #111;
    padding: 30px;
    border-radius: 15px;
    width: 350px;
    margin: 20px auto;
    border: 1px solid #333;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.sub-panel input {
    width: 100% !important; /* Genişliği zorla */
    box-sizing: border-box;  /* Taşmayı önleyen en önemli satır */
    padding: 12px;
    margin-bottom: 15px;
    background: #222;
    border: 1px solid #444;
    color: white;
    border-radius: 5px;
    display: block; /* Alt alta gelmelerini sağlar */
}

.primary-btn {
    width: 100%;
    padding: 12px;
    background: #e50914;
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
}

.back-link {
    background: none;
    border: none;
    color: #888;
    margin-top: 15px;
    cursor: pointer;
}

.back-link:hover { color: white; }

.qr-box {
    background: white;
    padding: 10px;
    display: inline-block;
    border-radius: 8px;
    margin-bottom: 10px;
}
/* Giriş kutusunu ve elemanlarını hizalar */
.sub-panel {
    background: rgba(20, 20, 20, 0.95);
    padding: 40px;
    border-radius: 15px;
    width: 350px;
    border: 1px solid #333;
    box-shadow: 0 15px 35px rgba(0,0,0,0.8);
    text-align: center;
}

.sub-panel input {
    width: 100%;
    box-sizing: border-box; /* Taşmayı kesin çözer */
    padding: 12px;
    margin-bottom: 20px;
    background: #252525;
    border: 1px solid #444;
    color: white;
    border-radius: 5px;
}
.primary-btn {
    width: 100%;
    padding: 12px;
    background: #e50914; /* TONS Kırmızısı */
    border: none;
    color: white;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
}
/* Cihaz ID Bilgi Yazısı */
.device-info {
    font-size: 12px;
    color: #888;
    margin-top: 15px;
    border-top: 1px solid #333;
    padding-top: 10px;
}
.id-badge {
    background: #222;
    color: #fff;
    padding: 15px;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 2px;
    border-radius: 8px;
    border: 1px dashed #e50914;
    margin: 20px 0;
}