/* style.css - Karanlık Mod Destekli Final Sürüm */

:root { 
    /* Varsayılan (Aydınlık) Tema Değişkenleri */
    --primary: #800000; 
    --primary-light: #9e2a2a; 
    --accent: #d4af37; 
    --bg-color: #fdfbf7; 
    --card-bg: #ffffff; 
    --text: #333; 
    --text-light: #777; 
    --border-color: #eee;
    --input-bg: #fcfcfc;
    --radius: 16px; 
    --shadow: 0 4px 20px rgba(0,0,0,0.08); 
}

/* --- KARANLIK TEMA AYARLARI --- */
/* Body'ye data-theme="dark" eklendiğinde bu renkler geçerli olur */
body[data-theme="dark"] {
    --primary: #ff4d4d; /* Karanlıkta daha parlak kırmızı */
    --primary-light: #ff6666;
    --accent: #ffd700;
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text: #e0e0e0;
    --text-light: #aaa;
    --border-color: #333;
    --input-bg: #2c2c2c;
    --shadow: 0 4px 20px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body { 
    font-family: 'Poppins', sans-serif; 
    background-color: var(--bg-color);
    /* Arkaplan deseni karanlık modda uyumlu hale getirildi */
    background-image: radial-gradient(var(--accent) 0.5px, transparent 0.5px), radial-gradient(var(--accent) 0.5px, var(--bg-color) 0.5px);
    background-size: 20px 20px;
    color: var(--text); 
    height: 100vh;
    height: 100dvh; 
    overflow: hidden; 
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s, color 0.3s; /* Yumuşak geçiş */
}

/* --- ÜST BAR --- */
.top-bar {
    background: var(--card-bg); /* Sabit beyaz yerine değişkene bağladık */
    padding: 0 15px; 
    display: flex;
    align-items: center;
    justify-content: space-between; 
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    flex-shrink: 0; 
    height: 70px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    transition: background 0.3s;
}

/* Sol taraftaki buton grubu (Menü ve Tema butonu için) */
.left-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-btn, .theme-toggle-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--primary);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}
.menu-btn:hover, .theme-toggle-btn:hover {
    background: rgba(128, 0, 0, 0.1);
}
/* Karanlık modda hover */
body[data-theme="dark"] .menu-btn:hover, 
body[data-theme="dark"] .theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.page-title-desktop {
    font-family: 'Amiri', serif;
    font-size: 1.6rem;
    color: var(--primary);
    margin: 0;
    font-weight: 700;
}

/* Masaüstü "Ana Sayfa" Butonu */
.desktop-home-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--primary);
    color: #fff !important; /* Buton yazısı hep beyaz kalsın */
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(0,0,0, 0.2);
    transition: all 0.3s ease;
    white-space: nowrap;
}
.desktop-home-btn:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
}

/* --- AÇILIR MENÜ --- */
#mobileMenu {
    display: none;
    background: var(--card-bg); /* Değişken kullanıldı */
    border-bottom: 1px solid var(--border-color);
    padding: 20px;
    flex-direction: column;
    gap: 15px;
    position: absolute;
    top: 70px; 
    left: 0;
    width: 100%;
    z-index: 99;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

#mobileMenu.show { display: flex; }

.menu-link {
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    padding: 15px;
    background: var(--input-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    display: block;
    text-align: center;
    transition: transform 0.2s;
}

/* --- ANA İÇERİK --- */
.content-wrapper {
    display: flex;
    flex: 1; 
    min-height: 0; 
    overflow: hidden; 
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 20px;
    gap: 25px;
}

/* --- PLAYER KARTI --- */
.player-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 25px;
    width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: background 0.3s;
}

#visualizer { width: 100%; height: 50px; border-radius: 8px; background: rgba(0,0,0,0.05); margin-bottom: 10px; }
/* Karanlık modda visualizer arka planı */
body[data-theme="dark"] #visualizer { background: rgba(255,255,255,0.05); }

.vinyl-wrapper { 
    position: relative; width: 160px; height: 160px; margin: 15px auto; 
    border-radius: 50%; box-shadow: 0 10px 25px rgba(0,0,0,0.3); 
    transition: all 0.5s; flex-shrink: 0; 
}
.vinyl-record { width: 100%; height: 100%; border-radius: 50%; background: repeating-radial-gradient(#111 0, #111 2px, #222 3px, #222 4px); position: relative; display: flex; align-items: center; justify-content: center; }
.vinyl-label { width: 38%; height: 38%; background-color: var(--primary); border-radius: 50%; position: absolute; border: 3px solid var(--accent); display: flex; align-items: center; justify-content: center; color: var(--accent); font-size: 1.4rem; }
.spinning { animation: spin 6s linear infinite; }
.paused-spin { animation-play-state: paused; }
@keyframes spin { 100% { transform: rotate(360deg); } }

.track-info { width: 100%; margin-bottom: 15px; }
.track-info h2 { 
    font-family: 'Amiri', serif; 
    font-size: 1.4rem; 
    color: var(--primary); 
    margin: 10px 0 5px 0; 
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}
.track-info p { color: var(--text-light); font-size: 0.9rem; margin: 0; font-weight: 600; font-style: italic; }

.progress-container { width: 100%; margin-bottom: 15px; }
input[type="range"] { width: 100%; cursor: pointer; accent-color: var(--primary); height: 5px; border-radius: 5px; background: var(--border-color); }
.time-display { width: 100%; display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-light); margin-top: 5px; font-variant-numeric: tabular-nums; }

.controls { display: flex; align-items: center; justify-content: center; gap: 20px; width: 100%; margin-top: 5px; }
.btn-control { background: none; border: none; color: var(--text); font-size: 1.4rem; cursor: pointer; padding: 10px; transition: color 0.2s; }
.btn-control:hover { color: var(--primary); }
.play-pause { width: 60px; height: 60px; background: var(--primary); color: #fff; font-size: 1.5rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 5px 15px rgba(0,0,0,0.3); transition: transform 0.2s; }
.play-pause:active { transform: scale(0.95); }

.speed-control { font-size: 0.8rem; font-weight: 800; color: var(--primary); background: var(--input-bg); width: 45px; height: 32px; border-radius: 8px; border: 1px solid var(--border-color); cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* --- LİSTE KARTI --- */
.playlist-panel { 
    background: var(--card-bg); 
    border-radius: var(--radius); 
    box-shadow: var(--shadow); 
    display: flex; 
    flex-direction: column; 
    flex: 1; 
    min-height: 0; 
    overflow: hidden; 
    position: relative;
    transition: background 0.3s;
}

.search-box { 
    padding: 15px; 
    border-bottom: 1px solid var(--border-color); 
    background: var(--card-bg); 
    flex-shrink: 0; 
    z-index: 10;
}
.search-box input { 
    width: 100%; 
    padding: 12px 15px; 
    border: 2px solid var(--border-color); 
    border-radius: 10px; 
    font-family: inherit; 
    outline: none; 
    transition: all 0.3s; 
    font-size: 1rem; 
    background: var(--input-bg);
    color: var(--text);
}
.search-box input:focus { border-color: var(--primary); }

.playlist { 
    flex-grow: 1; 
    overflow-y: auto; 
    padding: 0;
    scrollbar-width: thin;
    padding-bottom: 40px; 
}
.playlist::-webkit-scrollbar { width: 6px; }
.playlist::-webkit-scrollbar-track { background: transparent; }
.playlist::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

.track-item { display: flex; align-items: center; padding: 14px 20px; cursor: pointer; border-bottom: 1px solid var(--border-color); transition: background 0.2s; }
.track-item:hover { background-color: var(--input-bg); }
/* Aktif şarkı stili */
.track-item.active { background-color: rgba(128, 0, 0, 0.05); border-left: 4px solid var(--primary); }
body[data-theme="dark"] .track-item.active { background-color: rgba(255, 77, 77, 0.1); }

.track-number { font-weight: bold; color: var(--accent); width: 40px; font-size: 0.9rem; flex-shrink: 0; }
.track-details { display: flex; flex-direction: column; overflow: hidden; flex: 1; }
.track-title { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.track-item.active .track-title { color: var(--primary); font-weight: 600; }
.track-artist { font-size: 0.8rem; color: var(--text-light); margin-top: 2px; }

/* Footer */
footer { background: var(--card-bg); border-top: 1px solid var(--border-color); text-align: center; padding: 10px; font-size: 0.75rem; color: var(--text-light); flex-shrink: 0; z-index: 50; }

/* --- MOBİL UYUM --- */
@media (max-width: 900px) {
    .page-title-desktop { display: none; }
    .desktop-home-btn { display: none !important; }
    
    .top-bar { height: 60px; padding: 0 15px; }
    #mobileMenu { top: 60px; }
    
    .content-wrapper { flex-direction: column; padding: 0; gap: 0; height: 100%; }
    
    .player-card { 
        width: 100%; height: auto; min-height: auto; 
        padding: 10px 15px; border-radius: 0; border-bottom: 1px solid var(--border-color); 
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        flex-direction: row; justify-content: flex-start; gap: 15px; 
        z-index: 20; overflow: visible; 
    }

    .vinyl-wrapper { width: 70px; height: 70px; margin: 0; box-shadow: none; border: 1px solid var(--border-color); }
    .vinyl-label { font-size: 0.8rem; border-width: 2px; }
    
    .mobile-right-side { flex: 1; display: flex; flex-direction: column; width: 100%; overflow: hidden; justify-content: center; }
    
    .track-info { margin: 0 0 5px 0; text-align: left; width: 100%; }
    .track-info h2 { 
        font-size: 1rem; margin: 0; 
        -webkit-line-clamp: 2; line-height: 1.2; 
    }
    .track-info p { display: none; }
    
    .controls { margin: 0; justify-content: space-between; gap: 0; width: 100%; }
    .play-pause { width: 40px; height: 40px; font-size: 1rem; box-shadow: none; }
    .btn-control { font-size: 1.1rem; padding: 8px; }
    .speed-control { width: 35px; height: 24px; font-size: 0.7rem; padding: 0; }
    
    #visualizer { display: none; }
    .progress-container { display: none; }
    
    .playlist-panel { border-radius: 0; box-shadow: none; flex-grow: 1; }
    .search-box { padding: 10px; }
    .search-box input { padding: 8px 12px; font-size: 0.9rem; }

    .playlist { padding-bottom: 100px; }
    .volume-container { display: none; }
}