/* EIGHTBORN MULTILIVE - STYLE (v20.0 - Clean & Fan Made) */

:root {
    --bg-color: #0f0f0f;
    --card-bg: #1e1e1e;
    --accent-color: #4a4a4a;
    --light-grey: #888;
    --drawer-width: 320px;
    --text-color: #e0e0e0;
    --active-green: #2e7d32;
    --github-color: #6e5494; /* GitHub Moru */
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    display: flex;
    overflow-x: hidden;
}

/* --- MENÜ BUTONU --- */
.btn-toggle {
    background: rgba(30, 30, 30, 0.9);
    color: white;
    position: fixed;
    top: 20px; left: 20px; z-index: 2000;
    cursor: pointer; border-radius: 8px; width: 45px; height: 45px;
    font-size: 24px; border: 1px solid #444;
    transition: background 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.btn-toggle:hover { background: var(--accent-color); border-color: var(--accent-color); }

/* --- DRAWER --- */
#drawer {
    width: var(--drawer-width); height: 100vh; background: #121212;
    position: fixed; top: 0; left: 0;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000; border-right: 1px solid #333;
    display: flex; flex-direction: column;
    will-change: transform;
}
#drawer.open { transform: translateX(0); }

.drawer-content { padding: 80px 20px 20px 20px; overflow-y: auto; flex: 1; }

h3 { margin-top: 0; border-bottom: 1px solid #333; padding-bottom: 10px; color: #fff; display: flex; align-items: center; justify-content: space-between; }

/* --- DRAWER FOOTER (YENİ) --- */
.drawer-footer {
    padding: 20px;
    border-top: 1px solid #333;
    background: #0e0e0e;
    text-align: center;
    font-size: 12px;
    color: #666;
}
.fan-badge {
    background: #d32f2f; color: white; padding: 2px 6px;
    border-radius: 4px; font-size: 10px; font-weight: bold;
    margin-left: 5px; vertical-align: middle;
}
.github-btn {
    display: flex; align-items: center; justify-content: center;
    background: #24292e; color: white; text-decoration: none;
    padding: 10px; border-radius: 6px; margin-top: 10px;
    font-weight: 600; transition: background 0.2s; border: 1px solid #444;
}
.github-btn:hover { background: var(--github-color); border-color: var(--github-color); }

/* --- SWITCH --- */
.switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #444; transition: .4s; border-radius: 20px;
}
.slider:before {
    position: absolute; content: "";
    height: 14px; width: 14px; left: 3px; bottom: 3px;
    background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--active-green); }
input:checked + .slider:before { transform: translateX(16px); }

.setting-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; background: #1a1a1a; padding: 10px; border-radius: 6px;
}

/* --- LISTE ÖĞELERİ --- */
.channel-list-item {
    display: flex; justify-content: space-between; align-items: center;
    background: #1a1a1a; padding: 8px 10px; margin-bottom: 8px; border-radius: 6px;
    cursor: grab; border: 1px solid transparent; transition: all 0.2s;
}
.channel-list-item:active { cursor: grabbing; }
.channel-list-item.dragging { opacity: 0.5; border: 1px dashed #666; background: #222; }
.channel-list-item.drag-over { border-bottom: 2px solid var(--accent-color); }
.channel-list-item.passive { opacity: 0.6; background: #141414; }
.channel-list-item.passive .name-text { text-decoration: line-through; color: #777; }
/* --- GÜNCELLENMİŞ BUTON STİLLERİ --- */

/* Aksiyon Butonları Kapsayıcısı */
.item-actions {
    display: flex;
    gap: 8px; /* Butonlar arası boşluk */
    align-items: center;
}

/* Genel İkon Butonu */
.btn-icon {
    background: transparent;
    border: 1px solid #444;
    color: #aaa;
    width: 32px; height: 32px; /* Biraz büyüttük */
    border-radius: 6px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
}

/* Hover Efektleri */
.btn-icon:hover {
    background: #333;
    color: white;
    border-color: #666;
}

/* Düzenle (Kalem) Butonu Özel Rengi */
.btn-edit:hover {
    background: rgba(33, 150, 243, 0.1); /* Mavi tonlu arka plan */
    color: #2196f3;
    border-color: #2196f3;
}

/* Sil (Çöp Kutusu) Butonu Özel Rengi */
.btn-delete:hover {
    background: rgba(244, 67, 54, 0.1); /* Kırmızı tonlu arka plan */
    color: #f44336;
    border-color: #f44336;
}

/* SVG İkonların Boyutu */
.btn-icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor; /* Butonun rengini alır */
}

/* --- OVERLAY --- */
#overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); z-index: 900;
    opacity: 0; visibility: hidden; transition: opacity 0.2s ease;
}
body.drawer-active #overlay { opacity: 1; visibility: visible; }

/* --- MAIN CONTENT --- */
.main-content { flex: 1; padding: 20px 40px; margin-top: 70px; }

/* --- GRID --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px; padding-bottom: 50px;
}

/* --- KART --- */
.card {
    background: var(--card-bg); border-radius: 12px; overflow: hidden;
    border: 1px solid #333; transition: all 0.3s ease;
    display: flex; flex-direction: column;
    contain: content;
}
.card.active {
    order: -9999 !important;
    grid-column: 1 / -1; width: 85%; margin: 0 auto 40px auto;
    border: 2px solid var(--accent-color); z-index: 100;
}

.header {
    padding: 12px 15px; background: #252525;
    display: flex; justify-content: flex-start; align-items: center;
    font-size: 14px; font-weight: 600; cursor: pointer;
    border-bottom: 1px solid #333;
}
.header:hover { background: #333; }
.card.active .header { background: var(--accent-color); }

.video-wrapper { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }

/* --- FORM --- */
.input-group { margin-bottom: 15px; }
.input-group label { display: block; margin-bottom: 5px; font-size: 12px; color: #aaa; }
input[type="text"] { background: #222; border: 1px solid #444; color: white; padding: 10px; width: 100%; border-radius: 6px; box-sizing: border-box; outline: none; }
.btn { width: 100%; padding: 10px; border-radius: 6px; border: none; cursor: pointer; font-weight: 600; transition: background 0.2s; }
.btn-add { background: var(--accent-color); color: white; }
.btn-add:hover { background: #5a5a5a; }

/* --- ÖZEL MODAL (POPUP) STİLLERİ --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7); /* Arkası yarı saydam siyah */
    z-index: 5000; /* Her şeyin üstünde */
    display: none; /* Varsayılan gizli */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-box {
    background: #1e1e1e;
    padding: 25px;
    border-radius: 12px;
    width: 320px;
    border: 1px solid #333;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.modal-overlay.show .modal-box {
    transform: scale(1);
}

.modal-box h3 {
    margin-top: 0;
    color: white;
    text-align: center;
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

/* --- SCROLLBAR (KAYDIRMA ÇUBUĞU) ÖZELLEŞTİRME --- */

/* 1. Webkit Tarayıcılar (Chrome, Edge, Opera, Safari) */
.drawer-content::-webkit-scrollbar {
    width: 8px; /* Çubuğun genişliği (İnce) */
}

.drawer-content::-webkit-scrollbar-track {
    background: #121212; /* Çubuğun arka planı (Menü ile aynı renk) */
}

.drawer-content::-webkit-scrollbar-thumb {
    background-color: #333; /* Çubuğun kendisi (Koyu Gri) */
    border-radius: 4px; /* Köşeleri yuvarlat */
    border: 2px solid #121212; /* Kenarlardan boşluk varmış gibi gösterir */
}

.drawer-content::-webkit-scrollbar-thumb:hover {
    background-color: #4a4a4a; /* Üzerine gelince biraz daha belirgin olsun (Accent Color) */
}

/* 2. Firefox İçin (Daha kısıtlı ayar sunar) */
.drawer-content {
    scrollbar-width: thin; /* İnce çubuk */
    scrollbar-color: #333 #121212; /* Çubuk Rengi - Arka Plan Rengi */
}

/* --- KART BAŞLIK DÜZENİ (GÜNCEL) --- */

/* Header içindeki elemanları hizala */
.header {
    padding: 8px 15px;
    background: #252525;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    height: 45px;
    box-sizing: border-box;
}

.title-text {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
    flex: 1; /* İsim alana yayılsın */
}

.card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

/* BUTON ANA YAPISI */
.btn-header {
    background: #333; /* Hafif arka plan */
    border: 1px solid #444;
    color: #ccc;
    height: 28px; /* Yükseklik sabit */
    width: auto;  /* GENİŞLİK SERBEST (Yazıya göre uzasın) */
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px; /* Yazı için sağ-sol boşluk */
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
}

.btn-header:hover {
    background: #444;
    color: white;
    border-color: #666;
}

/* İKON AYARI */
.btn-header svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    margin-right: 6px; /* İkon ile yazı arasına boşluk */
}

/* YAZI AYARI */
.btn-header span {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap; /* Yazı asla alt satıra inmesin */
    display: inline-block;
}

/* RENKLENDİRMELER */
.btn-link:hover {
    background: rgba(255, 0, 0, 0.15);
    color: #ff4e45;
    border-color: #ff4e45;
}

.btn-focus:hover {
    background: rgba(33, 150, 243, 0.15);
    color: #2196f3;
    border-color: #2196f3;
}

/* --- TİYATRO MODU VE GRID DÜZENİ (v25.0) --- */

/* 1. Normal Grid (Hiçbir şeye odaklanılmamışken) */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    padding-bottom: 50px;
    transition: all 0.3s ease;
}

/* 2. Tiyatro Modu (Birine odaklanılınca devreye girer) */
.grid.mode-focus {
    /* Sol taraf (3 birim) - Sağ taraf (1 birim veya 350px) */
    grid-template-columns: 1fr 380px;
    align-items: start; /* Yukarı hizala */
}

/* ODAKLANILAN KART (Büyük Sahne) */
.grid.mode-focus .card.active {
    grid-column: 1 / 2; /* Sol sütuna yerleş */
    /* Sağdaki liste ne kadar uzun olursa olsun, bu kart o kadar yer kaplasın */
    grid-row: 1 / 99;

    width: 100%;
    margin: 0;
    border: 2px solid var(--accent-color);
    z-index: 10;

    /* Yükseklik ayarı: Ekranı kaplasın ama taşmasın */
    height: calc(100vh - 100px);

    /* Scroll yaparken videoyu ekranda tut (Sticky) */
    position: sticky;
    top: 20px;
}

/* ODAKLANILMAYAN KARTLAR (Kenar Listesi) */
.grid.mode-focus .card:not(.active) {
    grid-column: 2 / 3; /* Sağ sütuna yerleş */
    width: 100%;
    height: auto; /* Yüksekliği serbest bırak */
    opacity: 0.9;
}
/* Kenardaki kartların videolarını biraz küçültelim */
.grid.mode-focus .card:not(.active) .video-wrapper {
    aspect-ratio: 16/9;
}


/* --- YENİ BUTON TASARIMI (TEXT İLE) --- */

/* Header Buton Grubu */
.card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Butonun Kendisi */
.btn-header {
    background: #333; /* Hafif arka plan */
    border: 1px solid #444;
    color: #ccc;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px; /* Metin için boşluk */
    transition: all 0.2s ease;
    text-decoration: none; /* Link alt çizgisini kaldır */
    font-family: inherit;
}

.btn-header:hover {
    background: #444;
    color: white;
    border-color: #666;
}

/* İkon Ayarı */
.btn-header svg {
    width: 16px; height: 16px;
    fill: currentColor;
    margin-right: 6px; /* İkon ile metin arası boşluk */
}

/* Metin Ayarı */
.btn-header span {
    font-size: 12px;
    font-weight: 600;
}

/* Kanala Git Özel Renk (YouTube Kırmızısı) */
.btn-link:hover {
    background: rgba(255, 0, 0, 0.15);
    color: #ff4e45;
    border-color: #ff4e45;
}

/* Odakla Butonu Özel Renk (Yeşil/Mavi) */
.btn-focus:hover {
    background: rgba(33, 150, 243, 0.15);
    color: #2196f3;
    border-color: #2196f3;
}

/* --- MOBİL UYUMLULUK --- */
@media (max-width: 1024px) {
    .grid.mode-focus {
        grid-template-columns: 1fr; /* Mobilde alt alta */
    }
    .grid.mode-focus .card.active {
        grid-column: 1;
        grid-row: auto;
        height: auto;
        position: relative;
        top: 0;
        margin-bottom: 20px;
    }
    .grid.mode-focus .card:not(.active) {
        grid-column: 1;
    }
}