/* =========================================
   1. TEMEL AYARLAR VE SIFIRLAMA
   ========================================= */
body {
    margin: 0;
    padding: 0;
    /* Radyal Gradyan: Ortadan dışa doğru açılan lacivert/siyah tonları */
    background: radial-gradient(circle at center, #1a1c2c, #0d0e15); 
    color: #ecf0f1;
    font-family: 'Poppins', sans-serif;
    
    /* Sayfayı tam ortalamak için Flexbox yapısı */
    display: flex;
    flex-direction: column; /* Öğeleri alt alta diz */
    align-items: center;    /* Yatayda ortala */
    justify-content: center; /* Dikeyde ortala */
    min-height: 100vh;      /* Sayfa yüksekliği ekran kadar olsun */
}

/* =========================================
   2. BAŞLIK VE METİNLER
   ========================================= */
.glow-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: #fff;
    /* Neon Efekti: Yazının etrafına renkli gölge vererek parlamasını sağlar */
    text-shadow: 0 0 10px rgba(0, 255, 200, 0.5), 0 0 20px rgba(0, 255, 200, 0.3);
    margin: 30px 0 20px 0;
    letter-spacing: 1px; /* Harf aralığını biraz aç */
    text-align: center;
}

.info-text {
    text-align: center;
    color: #95a5a6; /* Göz yormayan gri ton */
    margin-bottom: 15px;
    font-size: 0.9rem;
    font-weight: 300;
}

/* =========================================
   3. MÜZİK KUTUSU (JUKEBOX)
   ========================================= */
.jukebox {
    /* Glassmorphism: Buzlu cam efekti */
    background: rgba(255, 255, 255, 0.05); /* Çok şeffaf beyaz */
    backdrop-filter: blur(10px);           /* Arkadaki nesneleri bulanıklaştır */
    padding: 20px 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1); /* İnce çerçeve */
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    margin-bottom: 30px;
    
    /* İçerik hizalama */
    text-align: center;
    display: flex;
    gap: 15px; /* Öğeler arası boşluk */
    align-items: center;
    justify-content: center;
    flex-wrap: wrap; /* Mobilde sığmazsa alt satıra geçsin */
}

.jukebox h3 { display: none; } /* Başlığı gizle */

/* Şarkı Seçim Menüsü */
#songSelect {
    padding: 12px 20px;
    border-radius: 50px;
    border: none;
    background: #2c3e50;
    color: white;
    font-family: 'Poppins', sans-serif;
    outline: none;
    cursor: pointer;
    box-shadow: inset 2px 2px 5px rgba(0,0,0,0.2); /* İç gölge */
}

/* Çal/Durdur Butonları Genel */
.jukebox button {
    padding: 10px 25px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease; /* Hover efektleri yumuşak olsun */
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.play-btn {
    /* Yeşil Gradyan */
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: white;
    box-shadow: 0 4px 15px rgba(56, 239, 125, 0.4); /* Yeşil parlama */
}

.stop-btn {
    /* Kırmızı Gradyan */
    background: linear-gradient(135deg, #cb2d3e, #ef473a);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 71, 58, 0.4); /* Kırmızı parlama */
}

.jukebox button:hover {
    transform: translateY(-2px); /* Üzerine gelince hafif yukarı kalk */
    filter: brightness(1.1);     /* Rengi biraz parlat */
}

/* Şarkı çalarken durdur butonunun yanıp sönmesi */
.stop-btn.playing-now {
    animation: pulse-red 1.5s infinite;
}

/* =========================================
   4. PİYANO GÖVDESİ
   ========================================= */
.piano-container {
    background: #000;
    padding: 20px;
    border-radius: 15px;
    /* Piyanonun altındaki büyük gölge (3D hissi için) */
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), inset 0 1px 2px rgba(255,255,255,0.3);
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: 60px; /* Footer (Alt bilgi) çubuğu için boşluk */
}

/* Tuşları Kapsayan Alan */
.keys {
    display: flex;
    position: relative;
}

.key {
    position: relative;
    cursor: pointer;
    user-select: none; /* Tuşların seçilmesini engelle */
    transition: all 0.4s ease-out; /* Tuşu bırakınca rengi yavaşça eski haline dönsün */
    
    /* MOBİL İÇİN ÖNEMLİ: Dokununca çıkan mavi/gri kutuyu iptal et */
    -webkit-tap-highlight-color: transparent; 
}

/* =========================================
   5. BEYAZ TUŞLAR
   ========================================= */
.key.white {
    width: 60px;
    height: 220px;
    /* Fildişi görünümü için yukarıdan aşağı gradyan */
    background: linear-gradient(to bottom, #fff 0%, #eee 100%);
    border: 1px solid #ccc;
    border-radius: 0 0 5px 5px; /* Sadece alt köşeleri yuvarla */
    margin: 0 2px;
    
    /* Tuşun içbükey görünmesi için gölge oyunları */
    box-shadow: inset 0 -5px 10px rgba(0,0,0,0.1), 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1; /* Siyah tuşların altında kalmalı */
    
    /* Harfleri en alta hizalamak için */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 10px;
    color: #95a5a6;
}

/* Beyaz tuş basılma efekti (PC) */
.key.white:active, .key.white.pressed {
    background: linear-gradient(to bottom, #f1f1f1 0%, #e1e1e1 100%);
    transform: translateY(2px); /* Tuşu 2px aşağı it (Mekanik his) */
    box-shadow: inset 0 -2px 5px rgba(0,0,0,0.2);
    border-bottom: 5px solid #00d2ff; /* Altına neon mavi çizgi ekle */
}

/* =========================================
   6. SİYAH TUŞLAR (DÜZELTİLMİŞ)
   ========================================= */
.key.black {
    width: 40px;
    height: 140px;
    background: linear-gradient(to bottom, #333 0%, #000 100%);
    border-radius: 0 0 3px 3px;
    
    /* KRİTİK DÜZELTME: Absolute yerine Relative kullanıldı */
    position: relative; 
    
    /* İki beyaz tuşun üzerine binmesi için negatif kenar boşluğu */
    margin-left: -20px; 
    margin-right: -20px; 
    
    z-index: 2; /* Beyaz tuşların üzerinde durmalı */
    
    box-shadow: 2px 2px 5px rgba(0,0,0,0.5), inset 0 5px 5px rgba(255,255,255,0.1);
    
    /* Harf hizalama */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 15px;
    color: #7f8c8d;
}

/* Siyah tuş basılma efekti (PC) */
.key.black:active, .key.black.pressed {
    background: #111;
    transform: translateY(2px); /* Tuşu aşağı it */
    box-shadow: inset 0 0 10px #00d2ff; /* İçten neon ışık yak */
}

/* =========================================
   7. DİĞER DETAYLAR (Not İsimleri & Footer)
   ========================================= */
.note-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: #2c3e50;
}
.key.black .note-name { color: #fff; font-size: 0.9rem; }

.key-char {
    font-size: 0.7rem;
    text-transform: uppercase;
    opacity: 0.7;
    margin-top: 5px;
}

.footer {
    position: fixed; /* Sayfanın en altına sabitle */
    bottom: 0;
    width: 100%;
    text-align: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    color: #bdc3c7;
    font-size: 0.9rem;
    border-top: 1px solid #333;
}
.footer a { color: #00d2ff; text-decoration: none; font-weight: 600; }

/* Durdur butonu yanıp sönme animasyonu */
@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(239, 71, 58, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(239, 71, 58, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 71, 58, 0); }
}

/* =========================================
   8. MOBİL UYUMLULUK AYARLARI
   ========================================= */
/* --- MOBİL AYARLARI (GÜNCELLENMİŞ) --- */
@media (max-width: 800px) {
    .glow-title { font-size: 1.5rem; width: 100%; margin-top: 60px;}
    
    .piano-container {
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
        padding: 10px;
        background: transparent;
        box-shadow: none;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 30px;
    }

    .keys {
        min-width: 720px;
        margin: 0 auto;
    }

    .key-char, .info-text { display: none; }
    
    /* 1. BEYAZ TUŞLAR: Boşlukları (Margin) Sıfırla -> B-C arası kapanır */
    /* MOBİLDE BEYAZ TUŞLAR (BOŞLUKSUZ TAM SÜRÜM) */
    .key.white {
        /* 1. Önce tüm kenar boşluklarını SIFIRLA (Sol boşluk gitsin) */
        margin: 0 !important; 
        
        /* 2. Sonra sadece sağı eksi yap (Üst üste bindir) */
        margin-right: -1px !important; 
        
        /* 3. Köşeleri düzelt */
        border-radius: 0 !important;
        
        /* 4. Sabit ayarlar */
        width: 60px;
        box-shadow: inset 0 -5px 10px rgba(0,0,0,0.1);
        z-index: 1;
    }

    .key.white:last-child {
        margin-right: 0 !important;
    }

    /* Mobilde titreme olmasın diye hareketi iptal et */
    .key.white:active, .key.white.pressed {
        transform: none !important;
        border-bottom: 1px solid #ccc !important;
        background: #e6e6e6 !important;
    }

    /* 2. SİYAH TUŞLAR: Beyazlar birleşince kaymasın diye ortala */
    /* SİYAH TUŞLAR (DÜZELTİLMİŞ HALİ) */
    .key.black {
        width: 40px;
        height: 140px;
        background: linear-gradient(to bottom, #333 0%, #000 100%);
        border-radius: 0 0 3px 3px;
        
        position: relative; 
        margin-left: -20px; 
        margin-right: -20px; 
        z-index: 2; 

      
        /* Karmaşık dış gölgeyi kaldırdık, sadece iç parlama kaldı */
        box-shadow: inset 0 5px 5px rgba(255,255,255,0.1); 
        

        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        align-items: center;
        padding-bottom: 15px;
        color: #7f8c8d;
    }
}

/* =========================================
   9. ÖZEL KAYDIRMA ÇUBUĞU (SCROLLBAR)
   ========================================= */
.piano-container::-webkit-scrollbar { 
    height: 8px; /* Çubuğun kalınlığı */
}
.piano-container::-webkit-scrollbar-track { 
    background: rgba(255, 255, 255, 0.05); /* Çubuğun yolu (Silik arka plan) */
    border-radius: 4px; 
}
.piano-container::-webkit-scrollbar-thumb { 
    background: rgba(0, 210, 255, 0.3); /* Tutamaç (Neon Mavi, Şeffaf) */
    border-radius: 4px; 
}
.piano-container::-webkit-scrollbar-thumb:hover { 
    background: rgba(0, 210, 255, 0.6); /* Üzerine gelince parlasın */
}