/* SF Pro Display Font Entegrasyonu */
@font-face {
    font-family: 'SF Pro Display';
    src: url('https://raw.githubusercontent.com/hanadkubat/SF-Pro-Display-Font/main/SF-Pro-Display-Regular.otf') format('opentype');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'SF Pro Display';
    src: url('https://raw.githubusercontent.com/hanadkubat/SF-Pro-Display-Font/main/SF-Pro-Display-Medium.otf') format('opentype');
    font-weight: 500;
    font-display: swap;
}
@font-face {
    font-family: 'SF Pro Display';
    src: url('https://raw.githubusercontent.com/hanadkubat/SF-Pro-Display-Font/main/SF-Pro-Display-Bold.otf') format('opentype');
    font-weight: 700;
    font-display: swap;
}
@font-face {
    font-family: 'SF Pro Display';
    src: url('https://raw.githubusercontent.com/hanadkubat/SF-Pro-Display-Font/main/SF-Pro-Display-Black.otf') format('opentype');
    font-weight: 900;
    font-display: swap;
}

:root {
    /* Dark Tema Varsayılan Renkleri */
    --primary-bg: rgba(0, 0, 0, 0.85); /* Ana arka plan (şeffaf koyu) */
    --secondary-bg: rgba(255, 255, 255, 0.1); /* İkincil arka plan (şeffaf açık) */
    --text-color: #e0e0e0; /* Metin rengi */
    --highlight-color: #ff0000; /* Vurgu rengi (Kırmızı) */
    --border-color: rgba(255, 255, 255, 0.2); /* Kenarlık rengi */
    --shadow-color: rgba(0, 0, 0, 0.6); /* Gölge rengi, daha belirgin */
    --warning-bg: var(--primary-bg);
    --warning-text: var(--text-color); 
    --icon-filter: invert(1); /* Koyu tema için ikonlar beyaz */
    --mute-bar-color: rgba(128, 128, 128, 0.8); /* Mute durumunda ses çubuğu rengi (gri) */
    --channel-num-color-dark: #e0e0e0;
    --info-icon-dark: #ffffff; /* Dark mod için info ikon rengi */
    --settings-panel-header-bg: #333;
    --settings-item-bg-hover: rgba(255, 255, 255, 0.05);
    --accordion-header-bg: rgba(255, 255, 255, 0.08);
    --accordion-header-bg-hover: rgba(255, 255, 255, 0.15);
    --accordion-content-bg: rgba(255, 255, 255, 0.05);
    --input-bg: rgba(255, 255, 255, 0.1);
    --input-border: rgba(255, 255, 255, 0.3);
    --input-text: #e0e0e0;
    --button-bg: #ff0000;
    --button-text: white;
    --instructions-key-bg: rgba(255, 0, 0, 0.2); /* Hafif kırmızı */
    --instructions-key-text: #e0e0e0;
    --instructions-label-bg: rgba(255, 255, 255, 0.08); /* Klavye/Fare için */
    --tab-bg: rgba(255, 255, 255, 0.1);
    --tab-text: #e0e0e0;
    --tab-active-bg: #ff0000;
    --tab-active-text: white;
    --splash-bg: #333333; /* Gri tonu */
    --splash-ghost-text: black; /* Ghost yazısı siyah */
    --toggle-button-bg-off: rgba(255, 255, 255, 0.1);
    --toggle-button-text-off: var(--text-color);
    --toggle-button-bg-on: #ff0000;
    --toggle-button-text-on: white;

    /* Yeni Video Filtre Renkleri */
    --filter-handle-bg: #ff0000;
    --filter-track-bg: rgba(255, 255, 255, 0.3);
    --filter-value-color: #e0e0e0;
}

body.light-theme {
    /* Light Tema Renkleri */
    --primary-bg: rgba(255, 255, 255, 0.85);
    --secondary-bg: rgba(0, 0, 0, 0.1);
    --text-color: #333333;
    --highlight-color: #ff0000; /* Kırmızı */
    --border-color: rgba(0, 0, 0, 0.2);
    --shadow-color: rgba(0, 0, 0, 0.4);
    --warning-bg: var(--primary-bg);
    --warning-text: var(--text-color); 
    --icon-filter: invert(0); /* Açık tema için ikonlar siyah */
    --mute-bar-color: rgba(180, 180, 180, 0.8);
    --channel-num-color-light: #333333; 
    --info-icon-light: #000000; /* Light mod için info ikon rengi */
    --settings-panel-header-bg: #ccc;
    --settings-item-bg-hover: rgba(0, 0, 0, 0.05);
    --accordion-header-bg: rgba(0, 0, 0, 0.08);
    --accordion-header-bg-hover: rgba(0, 0, 0, 0.15);
    --accordion-content-bg: rgba(0, 0, 0, 0.05);
    --input-bg: rgba(0, 0, 0, 0.1);
    --input-border: rgba(0, 0, 0, 0.3);
    --input-text: #333333;
    --button-bg: #ff0000;
    --button-text: white;
    --instructions-key-bg: rgba(255, 0, 0, 0.2); /* Hafif kırmızı */
    --instructions-key-text: #333333;
    --instructions-label-bg: rgba(0, 0, 0, 0.08); /* Klavye/Fare için */
    --tab-bg: rgba(0, 0, 0, 0.1);
    --tab-text: #333333;
    --tab-active-bg: #ff0000;
    --tab-active-text: white;
    --splash-bg: #cccccc; /* Açık gri tonu */
    --splash-ghost-text: black; /* Ghost yazısı siyah */
    --toggle-button-bg-off: rgba(0, 0, 0, 0.1);
    --toggle-button-text-off: var(--text-color);
    --toggle-button-bg-on: #ff0000;
    --toggle-button-text-on: white;

    /* Yeni Video Filtre Renkleri */
    --filter-handle-bg: #ff0000;
    --filter-track-bg: rgba(0, 0, 0, 0.3);
    --filter-value-color: #333333;
}

body {
    margin: 0;
    overflow: hidden; 
    font-family: 'SF Pro Display', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: black; 
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    user-select: none; 
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: none; 
}

.tv-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: black; 
}

.video-player {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain; 
    transition: object-fit 0.3s ease; 
}

/* Başlangıç Ekranı */
.splash-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--splash-bg); 
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), visibility 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-logo {
    font-family: 'SF Pro Display', sans-serif; 
    font-size: 5.5em;
    font-weight: 900; 
    letter-spacing: -3px; 
    animation: fadeInScale 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    opacity: 0;
    transform: scale(0.7);
    position: relative;
    z-index: 1;
    display: flex;
    align-items: baseline; 
    gap: 15px;
}

.splash-logo .ghost-text {
    color: var(--splash-ghost-text); /* Ghost yazısı siyah */
    text-shadow: 0 0 15px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 0, 0, 0.3); /* Siyah gölge eklendi */
    animation: pulseGlowBlack 2s infinite alternate ease-in-out; /* Yeni animasyon */
}

.splash-logo .tv-text {
    color: #ff0000;
    font-size: 0.5em; 
    text-shadow: 0 0 30px rgba(255, 0, 0, 0.8), 0 0 60px rgba(255, 0, 0, 0.6);
    animation: pulseGlowRed 2s infinite alternate ease-in-out;
}


.splash-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0,0,0,0) 0%, rgba(0,0,0,0.7) 100%);
    z-index: 0; 
    overflow: hidden; 
}

.particle {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.5); 
    border-radius: 50%;
    animation: floatAndFade 10s infinite ease-in-out alternate;
}

@keyframes floatAndFade {
    0% {
        transform: translate(0, 0) scale(0.5);
        opacity: 0.5;
    }
    50% {
        transform: translate(100px, 200px) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translate(0, 0) scale(0.5);
        opacity: 0.5;
    }
}


@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.7); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulseGlowRed {
    0% { text-shadow: 0 0 30px rgba(255, 0, 0, 0.8), 0 0 60px rgba(255, 0, 0, 0.6); }
    50% { text-shadow: 0 0 45px rgba(255, 0, 0, 1), 0 0 80px rgba(255, 0, 0, 0.8); }
    100% { text-shadow: 0 0 30px rgba(255, 0, 0, 0.8), 0 0 60px rgba(255, 0, 0, 0.6); }
}

@keyframes pulseGlowBlack {
    0% { text-shadow: 0 0 15px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 0, 0, 0.3); }
    50% { text-shadow: 0 0 25px rgba(0, 0, 0, 0.7), 0 0 40px rgba(0, 0, 0, 0.5); }
    100% { text-shadow: 0 0 15px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 0, 0, 0.3); }
}


/* Kanal Listesi Paneli */
.channel-list-panel {
    position: absolute;
    top: 50%; 
    left: -320px; 
    transform: translateY(-50%) scale(0.9); 
    opacity: 0; 
    visibility: hidden;
    width: 280px;
    max-height: 90%; 
    margin-left: 20px; 
    background: var(--primary-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden; 
}

.channel-list-panel.active {
    left: 20px; 
    opacity: 1;
    transform: translateY(-50%) scale(1); 
    visibility: visible;
}
.channel-list-panel.active.with-category { /* Kategori paneli açıksa kanal listesi sağa kaydır */
    left: 320px; 
}


.channel-list-header {
    padding: 20px;
    font-size: 1.5em;
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-color);
}

/* Kanal listesi için stil */
.channel-list {
    list-style: none;
    padding: 10px 0;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
    outline: none;
}

.channel-list::-webkit-scrollbar {
    width: 0px;
    display: none; 
}
.channel-list {
    -ms-overflow-style: none; 
    scrollbar-width: none; 
}

.channel-list li {
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.channel-list li.selected {
    background-color: #ff0000;
    color: white;
    font-weight: bold;
}

.channel-list li:hover {
    background-color: var(--secondary-bg);
}

.channel-list li:active {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(0.98);
}

.channel-list li .channel-number {
    margin-right: 10px;
    font-weight: bold;
    width: 30px;
    text-align: right;
}

.channel-list li .channel-logo-small {
    width: 30px;
    height: 30px;
    object-fit: contain;
    margin-right: 10px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Kategori Paneli */
.category-panel {
    position: absolute;
    top: 50%;
    left: -320px; 
    transform: translateY(-50%) scale(0.9);
    opacity: 0;
    visibility: hidden; 
    width: 280px;
    max-height: 90%;
    margin-left: 20px;
    background: var(--primary-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100; 
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.category-panel.active {
    left: 20px; 
    opacity: 1;
    visibility: visible; 
    transform: translateY(-50%) scale(1);
}

.category-list-header {
    padding: 20px;
    font-size: 1.5em;
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-color);
}

.category-list {
    list-style: none;
    padding: 10px 0;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
    outline: none;
}

.category-list::-webkit-scrollbar {
    width: 0px;
    display: none;
}
.category-list {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.category-list li {
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.category-list li.selected {
    background-color: #ff0000;
    color: white;
    font-weight: bold;
}

.category-list li:hover {
    background-color: var(--secondary-bg);
}

.category-list li:active {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(0.98);
}

/* Yeni Kalite Seçim OSD'si, Ses/Altyazı OSD'si */
.quality-selection-osd, .audio-subtitle-osd {
    position: absolute;
    top: 50%;
    left: -320px; 
    transform: translateY(-50%) scale(0.9);
    opacity: 0;
    visibility: hidden;
    width: 280px;
    max-height: 90%;
    margin-left: 20px;
    background: var(--primary-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.quality-selection-osd.active, .audio-subtitle-osd.active {
    left: 20px; 
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1);
}
/* Konumlandırma Mantığı (en soldan sağa doğru, yan yana) */
.category-panel.active + .channel-list-panel.active { 
    left: 320px; 
}
.category-panel.active + .channel-list-panel.active + .quality-selection-osd.active,
.category-panel.active + .channel-list-panel.active + .audio-subtitle-osd.active {
    left: 620px; 
}
.channel-list-panel.active:not(.with-category) + .quality-selection-osd.active,
.channel-list-panel.active:not(.with-category) + .audio-subtitle-osd.active {
    left: 320px; 
}
.quality-selection-osd.active:not(.with-channel-list):not(.with-category-panel),
.audio-subtitle-osd.active:not(.with-channel-list):not(.with-category-panel) {
    left: 20px;
}

.quality-list-header, .audio-subtitle-header {
    padding: 20px;
    font-size: 1.5em;
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-color);
}

.quality-list, .audio-subtitle-list {
    list-style: none;
    padding: 10px 0;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
    outline: none;
}

.quality-list::-webkit-scrollbar, .audio-subtitle-list::-webkit-scrollbar {
    width: 0px;
    display: none;
}
.quality-list, .audio-subtitle-list {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.quality-list li, .audio-subtitle-list li {
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.quality-list li.selected, .audio-subtitle-list li.selected {
    background-color: #ff0000;
    color: white;
    font-weight: bold;
}

.quality-list li:hover, .audio-subtitle-list li:hover {
    background-color: var(--secondary-bg);
}

.quality-list li:active, .audio-subtitle-list li:active {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(0.98);
}


/* OSD (On-Screen Display) - Sağ Orta Ses Kartı */
.osd {
    position: absolute;
    top: 50%;
    right: 50px; 
    transform: translateY(-50%) scale(0.9);
    opacity: 0;
    visibility: hidden;
    background: var(--primary-bg);
    backdrop-filter: blur(8px);
    border-radius: 23px;
    padding: 30px 20px; 
    box-shadow: 0 10px 30px var(--shadow-color); 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 101;
    display: flex;
    flex-direction: column;
    align-items: center; 
    width: 85px; 
    height: 600px; 
    justify-content: center; 
    box-sizing: border-box; 
}

.osd.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1);
}

/* Ses Barı */
.volume-bar {
    flex-direction: column; 
    width: 130%; 
    height: 100%; 
    align-items: center;
    justify-content: center; 
    padding: 0;
    gap: 0; 
}

.volume-level-container {
    height: 550px; 
    width: 60px; 
    background-color: var(--secondary-bg);
    border-radius: 23px; 
    overflow: hidden;
    position: relative;
    flex-shrink: 0; 
}

.volume-level {
    width: 100%;
    height: 50%; 
    background-color: #ff0000; 
    border-radius: 23px;
    position: absolute;
    bottom: 0; 
    transition: height 0.1s ease-out, background-color 0.2s ease; 
}

.volume-level.muted {
    background-color: var(--mute-bar-color); 
}

.volume-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff; 
    font-size: 2.0em; 
    font-weight: bold;
    text-shadow: 1px 1px 15px rgba(0,0,0,10.5); 
    z-index: 1; 
}

/* Sayı Tuşu Kanal Numarası OSD'si ( sağ üst) */
.number-input-osd {
    position: absolute;
    top: 20px; 
    right: 20px; 
    background: var(--primary-bg);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 15px 25px;
    box-shadow: 0 10px 30px var(--shadow-color);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 105;
    font-size: 3em;
    font-weight: 900;
    color: var(--text-color);
    transform: translateY(-10px) scale(0.9);
    white-space: nowrap;
}

.number-input-osd.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Video Boyutu OSD (Sağ Üst, numara altı) */
.video-size-osd {
    position: absolute;
    top: 20px; 
    right: 20px;
    background: var(--primary-bg);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 8px 15px;
    box-shadow: 0 5px 15px var(--shadow-color);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 101;
    font-size: 1.3em; 
    font-weight: 900; 
    letter-spacing: -0.5px; 
    color: var(--text-color);
    transform: translateY(-10px) scale(0.9);
    white-space: nowrap;
}

.video-size-osd.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Kalite Uyarı OSD (Sağ Alt, hata mesajının altında) */
.quality-alert-osd {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: var(--primary-bg);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 15px 25px;
    box-shadow: 0 10px 30px var(--shadow-color);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 101;
    font-size: 1.2em;
    font-weight: 700;
    color: var(--text-color); 
    transform: translateY(20px) scale(0.9);
    white-space: nowrap;
}

.quality-alert-osd.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Hata Mesajı OSD (Sağ Alt) */
.error-osd {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: var(--primary-bg);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 15px 25px;
    box-shadow: 0 10px 30px var(--shadow-color);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 101;
    font-size: 1.2em;
    font-weight: 700;
    color: #ff0000; 
    transform: translateY(20px) scale(0.9);
}

.error-osd.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Tema Değişimi Uyarısı OSD (Alt Orta) */
.theme-alert-osd {
    position: absolute;
    bottom: 20px;
    left: 50%; 
    transform: translateX(-50%) translateY(20px) scale(0.9);
    opacity: 0;
    visibility: hidden;
    background: var(--primary-bg);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 15px 25px;
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 101;
    font-size: 1.2em;
    font-weight: 700;
    color: var(--text-color); 
    white-space: nowrap;
}

.theme-alert-osd.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
}

/* Ayarlar Kaydet/Sıfırla OSD'si */
.settings-status-osd {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: var(--primary-bg);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 15px 25px;
    box-shadow: 0 10px 30px var(--shadow-color);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 101;
    font-size: 1.2em;
    font-weight: 700;
    color: var(--text-color); 
    transform: translateY(20px) scale(0.9);
    white-space: nowrap;
}

.settings-status-osd.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Ekran Görüntüsü OSD'si */
.screenshot-osd {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: var(--primary-bg);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 15px 25px;
    box-shadow: 0 10px 30px var(--shadow-color);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 101;
    font-size: 1.2em;
    font-weight: 700;
    color: var(--text-color); 
    transform: translateY(20px) scale(0.9);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 15px;
}

.screenshot-osd.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.screenshot-osd .download-icon {
    font-size: 2.5em; /* Büyük ikon */
    color: var(--highlight-color);
}


/* Kanal Bilgi Kartı (Alt Orta) */
.channel-info-card {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px) scale(0.9); 
    opacity: 0;
    visibility: hidden;
    background: var(--primary-bg);
    backdrop-filter: blur(8px);
    border-radius: 15px; 
    padding: 20px 30px;
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 102;
    display: flex;
    align-items: center;
    justify-content: space-between; 
    gap: 20px;
    white-space: nowrap; 
    width: calc(100% - 100px); 
    max-width: 1200px; 
    box-sizing: border-box; 
}

.channel-info-card.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
}

.channel-info-card .channel-logo-large {
    width: 70px; 
    height: 70px;
    object-fit: contain;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.channel-info-card .channel-name-info { 
    display: flex;
    flex-grow: 1;
    justify-content: space-between; 
    align-items: center;
    gap: 20px;
}

.channel-info-card .channel-name-large {
    font-size: 2.5em; 
    font-weight: 900; 
    letter-spacing: -1px; 
    color: var(--text-color);
    flex-shrink: 1;
    overflow: hidden;
    text-overflow: ellipsis; 
}

.channel-info-card .channel-number-large {
    font-size: 3em; 
    font-weight: 900; 
    color: var(--channel-num-color-dark); 
}
body.light-theme .channel-info-card .channel-number-large {
    color: var(--channel-num-color-light); 
}

/* Yasal Uyarı Bildirimi */
.legal-notice {
    position: absolute;
    top: 20px;
    left: 20px; 
    background: var(--primary-bg); 
    color: var(--text-color); 
    padding: 10px 20px;
    border-radius: 10px;
    box-shadow: 0 5px 20px var(--shadow-color);
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 103;
    width: 380px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 25px;
    font-weight: 700;
    line-height: 1.3;
    min-height: 60px;
    transform: translateY(-20px) scale(0.9);
}

.legal-notice.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.legal-notice .info-icon {
    font-size: 2.5em;
    font-weight: 900;
    color: var(--info-icon-dark); 
}
body.light-theme .legal-notice .info-icon {
    color: var(--info-icon-light); 
}


/* Yeni eklenen kullanım talimatı bildirimi */
.instructions-tip-notice {
    position: absolute;
    top: 20px; /* Adjusted to be at the same top as legal notice */
    left: 20px;
    background: var(--primary-bg);
    color: var(--text-color);
    padding: 10px 20px;
    border-radius: 10px;
    box-shadow: 0 5px 20px var(--shadow-color);
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 103;
    width: 380px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 700;
    line-height: 1.3;
    min-height: 60px;
    transform: translateY(-20px) scale(0.9);
}

.instructions-tip-notice.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.instructions-tip-notice .info-icon {
    font-size: 2.5em;
    font-weight: 900;
    color: var(--info-icon-dark); 
}
body.light-theme .instructions-tip-notice .info-icon {
    color: var(--info-icon-light); 
}


/* Kullanım Talimatları Penceresi */
.instructions-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9); 
    width: 70%;
    max-width: 600px;
    max-height: 80vh;
    background: var(--primary-bg);
    backdrop-filter: blur(15px);
    border-radius: 15px;
    box-shadow: 0 15px 40px var(--shadow-color);
    padding: 25px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 104;
    overflow-y: auto;
    box-sizing: border-box;
}

.instructions-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.instructions-panel::-webkit-scrollbar {
    display: none;
}
.instructions-panel {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.instructions-panel h2 {
    text-align: center;
    color: #ff0000;
    margin-top: 0;
    font-size: 1.8em;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.instructions-panel ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.instructions-panel li {
    margin-bottom: 12px;
    font-size: 1em;
    line-height: 1.5;
}

/* Kullanım Talimatları Tuş Başlıkları Arka Planı */
.instructions-panel li strong.key-highlight {
    display: inline-block;
    padding: 2px 6px; 
    border-radius: 4px; 
    background-color: var(--instructions-key-bg); /* Hafif kırmızı */
    color: var(--instructions-key-text); 
    font-weight: 700;
    margin-right: 5px; 
    white-space: nowrap; 
    line-height: 1.2; 
    font-size: 0.9em; 
}
/* Klavye/Fare başlıklarına arka plan */
.instructions-panel li span.instruction-label {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: var(--instructions-label-bg);
    color: var(--instructions-key-text);
    font-weight: 700;
    margin-right: 5px;
    white-space: nowrap;
    line-height: 1.2;
    font-size: 0.9em;
}
/* Tuş açıklaması kısmında arkaplan olmasın */
.instructions-panel li strong:not(.key-highlight) {
    background-color: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    color: inherit !important;
}


/* Kanal sayısı bildirimi için yeni stil */
.channel-count-osd {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: var(--primary-bg);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 15px 25px;
    box-shadow: 0 10px 30px var(--shadow-color);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 101;
    font-size: 1.2em;
    font-weight: 700;
    color: var(--text-color);
    transform: translateY(20px) scale(0.9);
    white-space: nowrap;
}
.channel-count-osd.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Tam Ekran Butonu */
.fullscreen-button {
    position: absolute;
    top: -70px; 
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: var(--primary-bg);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 10px 20px;
    box-shadow: 0 10px 30px var(--shadow-color);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100; 
    color: var(--text-color);
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 10px;
}

.fullscreen-button.active {
    top: 20px; 
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

.fullscreen-button svg {
    width: 24px;
    height: 24px;
    fill: var(--text-color);
}

/* Ayarlar Penceresi */
.settings-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 70%;
    max-width: 600px; /* Sabit maksimum genişlik */
    height: 80vh; /* Sabit yükseklik */
    background: var(--primary-bg);
    backdrop-filter: blur(15px);
    border-radius: 15px;
    box-shadow: 0 15px 40px var(--shadow-color);
    padding: 25px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 104;
    box-sizing: border-box;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
}

.settings-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.settings-panel::-webkit-scrollbar {
    display: none;
}
.settings-panel {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.settings-panel h2 {
    text-align: center;
    color: #ff0000;
    margin-top: 0;
    font-size: 1.8em;
    font-weight: 700;
    padding-bottom: 12px; 
    margin-bottom: 10px; /* Azaltıldı */
}
/* Ayar sekmesi açıklamalarının boşlukları */
.settings-panel .tab-description {
    text-align: center; /* Ortalandı */
    font-size: 0.9em;
    color: var(--text-color);
    margin: 0 0 15px 0; /* Başlık altına geldiği için üst boşluk kaldırıldı */
    line-height: 1.4;
    font-weight: bold; /* Kalın yapıldı */
}
/* Ayarlar alt başlıkları ortalandı */
.settings-section h3 {
    text-align: center;
    color: var(--highlight-color);
    font-size: 1.3em;
    margin-bottom: 10px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 5px;
}

/* Sekme Tasarımı */
.settings-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    background: var(--secondary-bg); /* Sekmelerin birleşik arka planı */
    border-radius: 10px; /* Kenarları yumuşat */
    padding: 5px; /* İç boşluk */
    box-shadow: inset 0 0 8px rgba(0,0,0,0.2); /* İç gölge */
    /* Sekme arka planının genişliğini sabit tut */
    min-width: 350px; 
    max-width: 550px;
    width: auto; /* İçeriğe göre genişlemesini sağla */
    align-self: center; /* Ortaya hizala */
}

.tab-button {
    flex-grow: 1; /* Eşit genişlikte dağılsınlar */
    text-align: center;
    background-color: transparent;
    color: var(--text-color);
    padding: 8px 12px; /* Boyut küçültüldü */
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    z-index: 1; 
    outline: none; /* Odaklandığında varsayılan outline kaldırıldı */
    font-size: 0.9em; /* Font boyutu küçültüldü */
    border-radius: 8px; /* Butonların kenarlarını yumuşat */
    white-space: nowrap; /* Metnin kırılmasını engelle */
}
/* Aktif butonun odağında çerçeve olmasın */
.tab-button.active:focus {
    box-shadow: none; /* Aktif sekme odaklandığında border kaldırıldı */
}
/* Diğer butonların odaklandığında belirginleştirilmesi */
.tab-button:focus:not(.active) {
    box-shadow: none; /* Ayarlar ilk açıldığında seçili gibi gözüken border kaldırıldı */
}
/* Yeni eklenen: İlk tab butonu için varsayılan border'ı kaldır */
.settings-tabs .tab-button:first-child.active {
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); /* Aktifse normal gölge */
}

.tab-button.active {
    background-color: var(--highlight-color); /* Aktif sekme rengi */
    color: white; /* Aktif sekme metin rengi */
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); /* Dış gölge */
    transform: translateY(-2px); /* Hafif yukarı çıksın */
}
.tab-button:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.05); /* Hover'da hafif vurgu */
    color: var(--text-color);
}
.tab-button:active {
    transform: translateY(0);
}


.tab-content {
    flex-grow: 1;
    padding-top: 10px;
    overflow-y: auto;
    min-height: 0; 
}
.tab-content.hidden {
    display: none;
}
.tab-content::-webkit-scrollbar {
    display: none; 
}
.tab-content {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.settings-section {
    margin-bottom: 20px;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease;
    outline: none; 
}
.settings-item:focus-within { 
    background-color: var(--secondary-bg);
}


.settings-item:last-child {
    border-bottom: none;
}

.settings-item label {
    flex-grow: 1;
    font-size: 1.1em;
    margin-right: 15px;
    cursor: pointer; 
}

/* Toggle Button (Checkbox yerine) */
.toggle-button {
    width: 80px;
    height: 35px;
    border-radius: 20px;
    background-color: var(--toggle-button-bg-off);
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.3);
    position: relative;
    flex-shrink: 0;
    outline: none; 
}
.toggle-button:focus {
    box-shadow: 0 0 0 3px var(--highlight-color); 
}

.toggle-button .toggle-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
    margin-left: 2px;
}

.toggle-button.on {
    background-color: var(--toggle-button-bg-on);
}

.toggle-button.on .toggle-circle {
    transform: translateX(45px); 
}
.toggle-button .toggle-text { /* Yazılar kaldırıldı */
    display: none;
}


.settings-item select, .settings-item input[type="number"], .settings-item input[type="range"] {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--input-text);
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    -webkit-appearance: none; 
    -moz-appearance: none;
    appearance: none;
    outline: none; 
}
.settings-item select:focus, .settings-item input[type="number"]:focus, .settings-item input[type="range"]:focus {
    outline: 3px solid var(--highlight-color); 
    outline-offset: 1px;
}
/* Range input için özel stiller */
.settings-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--highlight-color);
    cursor: pointer;
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
    margin-top: -8px; 
}
.settings-item input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--highlight-color);
    cursor: pointer;
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
}
.settings-item input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 5px;
    background: var(--input-border);
    border-radius: 3px;
}
.settings-item input[type="range"]::-moz-range-track {
    width: 100%;
    height: 5px;
    background: var(--input-border);
    border-radius: 3px;
}

.settings-actions button {
    background-color: var(--button-bg);
    color: var(--button-text);
    font-weight: bold;
    padding: 12px 25px;
    font-size: 1.1em;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    outline: none;
}
.settings-actions button:hover {
    background-color: color-mix(in srgb, var(--button-bg) 90%, black); /* Hafif koyulaştır */
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}
.settings-actions button:active {
    transform: translateY(1px); /* Tıklamada aşağı kaydır */
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.settings-actions button:focus {
    box-shadow: 0 0 0 3px var(--highlight-color);
}

/* Accordion Stili */
.accordion-header {
    background-color: var(--accordion-header-bg);
    color: var(--text-color);
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: background-color 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    outline: none; 
}
.accordion-header:focus {
    box-shadow: 0 0 0 3px var(--highlight-color);
}

.accordion-header:hover {
    background-color: var(--accordion-header-bg-hover);
}

.accordion-header .arrow {
    transition: transform 0.3s ease;
    font-size: 0.8em;
}

.accordion-header.active .arrow {
    transform: rotate(90deg);
}

.accordion-content {
    background-color: var(--accordion-content-bg);
    padding: 0 15px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    border-radius: 8px;
}

.accordion-content.active {
    max-height: 500px; 
    padding: 10px 15px;
}
.accordion-content .settings-item {
    border-bottom: 1px dotted rgba(255, 255, 255, 0.08);
    padding: 8px 0;
}
.settings-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
    background: var(--secondary-bg); /* Sekmelerin birleşik arka planı */
    border-radius: 10px; /* Kenarları yumuşat */
    padding: 10px; /* İç boşluk */
    box-shadow: inset 0 0 8px rgba(0,0,0,0.2); /* İç gölge */
    align-self: center; /* Ortaya hizala */
}
.settings-actions button {
    padding: 10px 20px; /* Boyut küçültüldü */
    font-size: 1em; /* Font boyutu küçültüldü */
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.settings-actions button i {
    font-size: 1.1em;
}


/* Hakkında/Duyurular Sekmesi İçeriği */
.about-content {
    text-align: center;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.about-content img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 20px;
    border-radius: 50%;
    border: 2px solid var(--highlight-color);
}
/* Light mod için özel logo */
body.light-theme .about-content img.light-logo {
    display: block; 
}
body:not(.light-theme) .about-content img.light-logo {
    display: none; 
}
body.light-theme .about-content img.dark-logo {
     display: none; 
}
body:not(.light-theme) .about-content img.dark-logo {
    display: block; 
}


.about-content h3 {
    color: var(--highlight-color);
    font-size: 1.5em;
    margin-bottom: 10px;
}
.about-content p {
    font-size: 1em;
    line-height: 1.6;
    margin-bottom: 10px;
    text-align: left;
}
.about-content ul {
    list-style: disc;
    padding-left: 20px;
    text-align: left;
    margin-bottom: 15px;
}
.about-content li {
    margin-bottom: 5px;
}
/* İletişim Bilgileri */
.contact-info {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    width: 100%;
}
.contact-info h4 {
    color: var(--highlight-color);
    font-size: 1.2em;
    margin-bottom: 15px;
}
.contact-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    font-size: 0.95em;
}
.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--secondary-bg);
    padding: 10px 15px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}
.contact-item:hover {
    background-color: rgba(255, 255, 255, 0.15);
}
.contact-item i {
    color: var(--highlight-color);
    font-size: 1.3em;
}
.contact-item a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease;
}
.contact-item a:hover {
    color: var(--highlight-color);
}


/* Klavye Kısayolları Tablosu */
.keyboard-shortcuts-table {
    display: grid;
    grid-template-columns: 1fr 120px; /* Label, Key */
    gap: 10px;
    align-items: center;
    margin-top: 20px;
    background-color: var(--secondary-bg);
    border-radius: 10px;
    padding: 15px;
}

.keyboard-shortcuts-table .header-label,
.keyboard-shortcuts-table .header-key {
    font-weight: bold;
    color: var(--highlight-color);
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}
.keyboard-shortcuts-table .header-label { text-align: left; }
.keyboard-shortcuts-table .header-action { display: none; } /* Hide the action header */


.keyboard-shortcuts-table .shortcut-item {
    display: contents; /* Grid öğelerinin içeriğini dağıt */
}

.keyboard-shortcuts-table .shortcut-label {
    padding: 8px 0;
    font-size: 1em;
    color: var(--text-color);
}

.keyboard-shortcuts-table .shortcut-key {
    padding: 8px 0;
    text-align: center;
    font-weight: bold;
    color: var(--highlight-color);
    background-color: var(--input-bg);
    border-radius: 5px;
    border: 1px solid var(--input-border);
    cursor: pointer; /* Make it clickable */
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}
.keyboard-shortcuts-table .shortcut-key:hover {
    background-color: rgba(255, 255, 255, 0.2);
}
.keyboard-shortcuts-table .shortcut-key:focus {
    box-shadow: 0 0 0 2px var(--highlight-color);
}
.keyboard-shortcuts-table .shortcut-key.listening {
    background-color: rgba(255, 255, 0, 0.3); /* Sarımsı arka plan */
    border-color: yellow;
}
.keyboard-shortcuts-table .edit-button { /* Hide the edit button */
    display: none;
}


/* Video Filtre Ayarları Paneli */
.video-filter-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 70%;
    max-width: 400px;
    background: var(--primary-bg);
    backdrop-filter: blur(15px);
    border-radius: 15px;
    box-shadow: 0 15px 40px var(--shadow-color);
    padding: 25px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 105;
    box-sizing: border-box;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
}
.video-filter-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}
.video-filter-panel h3 {
    text-align: center;
    color: var(--highlight-color);
    margin-top: 0;
    font-size: 1.5em;
    font-weight: 700;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}
.filter-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
}
.filter-item label {
    width: 100px; /* Etiketler için sabit genişlik */
    flex-shrink: 0;
    font-weight: bold;
}
.filter-item input[type="range"] {
    flex-grow: 1;
    margin-right: 10px;
}
.filter-item .filter-value {
    width: 50px;
    text-align: right;
    font-weight: bold;
    color: var(--filter-value-color);
}
.filter-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}
.filter-actions button {
    background-color: var(--button-bg);
    color: var(--button-text);
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
    outline: none;
}
.filter-actions button:hover {
    background-color: color-mix(in srgb, var(--button-bg) 90%, black);
}
.filter-actions button:focus {
    box-shadow: 0 0 0 3px var(--highlight-color);
}