/* style.css - Gelişmiş Mobil Uyumlu 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[data-theme="dark"] {
    --primary: #ff4d4d;
    --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);
    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;
}

/* --- ÜST BAR --- */
.top-bar {
    background: var(--card-bg);
    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);
}

.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); }
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;
}

.desktop-home-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--primary);
    color: #fff !important;
    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;
}

/* --- AÇILIR MENÜ --- */
#mobileMenu {
    display: none;
    background: var(--card-bg);
    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;
}

/* --- 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;
}

#visualizer { width: 100%; height: 50px; border-radius: 8px; background: rgba(0,0,0,0.05); margin-bottom: 10px; }
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); 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;
}
.track-info p { color: var(--text-light); font-size: 0.9rem; 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; }

/* --- KONTROLLER (Desktop Optimize Edildi) --- */
.controls { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 12px; /* Butonlar arası mesafe daraltıldı */
    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); }

.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; }
.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; outline: none; background: var(--input-bg); color: var(--text); }
.search-box input:focus { border-color: var(--primary); }

.playlist { flex-grow: 1; overflow-y: auto; scrollbar-width: thin; padding-bottom: 40px; }
.track-item { display: flex; align-items: center; padding: 14px 20px; cursor: pointer; border-bottom: 1px solid var(--border-color); }
.track-item:hover { background-color: var(--input-bg); }
.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); }

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); }

/* --- MOBİL UYUM (Kesilme Sorunu Giderildi) --- */
@media (max-width: 900px) {
    .page-title-desktop, .desktop-home-btn { display: none !important; }
    
    .content-wrapper { flex-direction: column; padding: 0; height: 100%; }
    
    .player-card { 
        width: 100%; height: auto; 
        padding: 10px 8px; /* Yatay padding azaltıldı */
        border-radius: 0; border-bottom: 1px solid var(--border-color); 
        flex-direction: row; justify-content: flex-start; gap: 10px; 
        z-index: 20; overflow: visible; 
    }

    .vinyl-wrapper { width: 70px; height: 70px; margin: 0; flex-shrink: 0; }
    .mobile-right-side { flex: 1; display: flex; flex-direction: column; overflow: hidden; justify-content: center; }
    
    .track-info { margin: 0 0 5px 0; text-align: left; }
    .track-info h2 { font-size: 0.95rem; margin: 0; -webkit-line-clamp: 2; }
    .track-info p, #visualizer, .progress-container, .volume-container { display: none; }
    
    /* Butonların yan yana tam sığması için kritik düzenleme */
    .controls { 
        margin: 0; 
        justify-content: center; /* Merkeze hizalayarak kenar kesilmelerini önler */
        gap: 6px; /* Butonlar arası boşluk minimize edildi */
        width: 100%; 
        overflow: visible;
    }

    .btn-control { 
        font-size: 1rem; 
        padding: 6px; 
        min-width: 30px; /* Butonun daralmasını önler */
        flex-shrink: 0;
    }

    .speed-control { 
        width: 32px; 
        height: 24px; 
        font-size: 0.65rem; 
        flex-shrink: 0;
    }

    .play-pause { 
        width: 38px; 
        height: 38px; 
        font-size: 0.9rem; 
        flex-shrink: 0;
        box-shadow: none;
    }
    
    .playlist-panel { border-radius: 0; flex-grow: 1; }
    .playlist { padding-bottom: 100px; }
}