/* music_player.css - Minimal MP3 Player */

.audio-player-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #282828; /* Koyu gri */
    color: #e0e0e0;
    box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.4);
    z-index: 1500;
    display: none;
    transform: translateY(0);
    transition: transform 0.3s ease-out, height 0.3s ease-out;
    font-family: 'Roboto', sans-serif;
    padding-bottom: env(safe-area-inset-bottom, 0);
    border-top: 1px solid #444; /* İnce bir üst çizgi */
}

.audio-player-container.minimized {
    transform: translateY(100%);
    height: 0;
    overflow: hidden;
    padding-bottom: 0;
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background-color: #1e1e1e; /* Daha koyu header */
    border-bottom: 1px solid #3a3a3a;
}

.player-title {
    font-size: 1em;
    font-weight: 500;
    color: #1DB954; /* Spotify yeşili gibi vurgu rengi */
    display: flex;
    align-items: center;
    gap: 8px;
}
.player-title i {
    font-size: 1.1em;
}

.player-controls-top button {
    background: none;
    border: none;
    color: #b3b3b3;
    font-size: 1em;
    cursor: pointer;
    margin-left: 8px;
    transition: color 0.2s ease;
}
.player-controls-top button:hover {
    color: #fff;
}

.player-content {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    gap: 15px; /* Elemanlar arası boşluk */
    flex-wrap: wrap; /* Küçük ekranlarda esneklik */
}

.player-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
    min-width: 180px; /* Bilgi alanının minimum genişliği */
}

.song-cover {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.song-details {
    overflow: hidden; /* Taşmayı engelle */
}

.song-title {
    font-size: 1.1em;
    margin-bottom: 2px;
    color: #f0f0f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-artist {
    font-size: 0.85em;
    color: #a0a0a0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0; /* Küçülmesini engelle */
}

.player-controls button {
    background-color: transparent;
    border: none;
    color: #e0e0e0;
    font-size: 1.4em;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
    padding: 0; /* Minimal butonlar */
}
.player-controls button:hover {
    color: #1DB954; /* Vurgu rengi */
    transform: scale(1.1);
}
#play-pause-btn {
    font-size: 2em;
    color: #1DB954;
}
#play-pause-btn:hover {
    color: #27CC60;
}

.player-progress-bar {
    width: 100%;
    margin-top: 10px;
    order: 4; /* İçerik akışında altta olmasını sağlar */
}

#progress-bar {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #505050;
    border-radius: 2px;
    cursor: pointer;
    outline: none;
}
#progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #1DB954;
    cursor: pointer;
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
}
#progress-bar::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #1DB954;
    cursor: pointer;
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.75em;
    color: #a0a0a0;
    margin-top: 5px;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto; /* Sağ tarafa yasla */
    order: 3; /* İçerik akışında daha sonra gelmesini sağlar */
}
.volume-control button {
    font-size: 1.1em;
    padding: 0;
}
#volume-bar {
    width: 70px;
    -webkit-appearance: none;
    appearance: none;
    height: 3px;
    background: #505050;
    border-radius: 2px;
    cursor: pointer;
    outline: none;
}
#volume-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #1DB954;
    cursor: pointer;
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
}
#volume-bar::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #1DB954;
    cursor: pointer;
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
}

#playlist-toggle-btn {
    font-size: 1.4em;
    margin-left: 10px;
    order: 5; /* En sağa gitmesi için */
}


/* Playlist */
.player-playlist {
    background-color: #1e1e1e;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px 15px;
    border-top: 1px solid #3a3a3a;
    display: none;
    transition: max-height 0.3s ease-out;
}
.player-playlist.active {
    display: block;
}

.player-playlist h4 {
    color: #1DB954;
    margin-bottom: 10px;
    font-size: 1em;
    border-bottom: 1px dashed #3a3a3a;
    padding-bottom: 8px;
}

#playlist-items {
    list-style: none;
    padding: 0;
    margin: 0;
}
.playlist-item {
    display: flex;
    flex-direction: column; /* Mobil için dikey düzen */
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid #333;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.playlist-item:last-child {
    border-bottom: none;
}
.playlist-item:hover {
    background-color: #333;
}
.playlist-item.active {
    background-color: #3a3a3a;
    color: #1DB954;
    font-weight: bold;
}
.playlist-title {
    font-size: 0.95em;
    color: #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%; /* Tam genişlik kaplar */
}
.playlist-item.active .playlist-title {
    color: #1DB954; /* Aktif başlık vurgu rengi */
}
.playlist-artist {
    font-size: 0.75em;
    color: #a0a0a0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    margin-top: 2px;
}
.playlist-item.active .playlist-artist {
    color: #a0a0a0; /* Aktif sanatçı rengi */
}


/* Mini Player Icon */
.mini-player-icon {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: #1DB954;
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: none; /* Varsayılan olarak gizli */
    justify-content: center;
    align-items: center;
    font-size: 1.6em;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    z-index: 1600;
    transition: transform 0.2s ease, background-color 0.2s ease;
    animation: pulse 2s infinite;
}
.mini-player-icon:hover {
    transform: scale(1.08);
    background-color: #27CC60;
}

.mini-player-icon i.fa-play {
    transform: translateX(2px);
}


@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Body'ye player eklendiğinde içeriğin player tarafından kapanmasını önlemek için padding */
body.player-active {
    padding-bottom: 210px; /* Player'ın varsayılan yüksekliğine göre ayarlayın */
    transition: padding-bottom 0.3s ease-out;
}
body.player-minimized {
    padding-bottom: 70px; /* Mini ikonun yüksekliğine göre ayarlayın */
}


/* Responsive Ayarlamalar */
@media (max-width: 768px) {
    .audio-player-container {
        padding: 0; /* Kenar boşluklarını kaldır */
    }
    .player-header {
        padding: 6px 12px;
    }
    .player-title {
        font-size: 0.9em;
    }
    .player-content {
        flex-direction: row; /* Mobil için satırda tutmaya çalış */
        flex-wrap: wrap; /* Gerekirse sarsın */
        justify-content: center;
        gap: 8px;
        padding: 8px 12px;
    }
    .player-info {
        width: 100%; /* Tam genişlik kaplar */
        justify-content: center; /* Ortala */
        order: 1;
        margin-bottom: 5px; /* Alttaki elemanlardan ayır */
    }
    .song-cover {
        width: 50px;
        height: 50px;
    }
    .song-title {
        font-size: 1em;
        text-align: left; /* Bilgi sola hizalı kalsın */
    }
    .song-artist {
        font-size: 0.8em;
        text-align: left;
    }

    .player-controls {
        order: 2;
        width: 100%;
        justify-content: center;
        gap: 10px;
        margin-bottom: 5px;
    }
    .player-controls button {
        font-size: 1.2em;
    }
    #play-pause-btn {
        font-size: 1.8em;
    }
    .player-progress-bar {
        order: 3;
        width: 100%;
    }
    .time-display {
        font-size: 0.7em;
    }
    .volume-control {
        order: 5; /* playlist-toggle-btn'den sonra gelsin */
        width: auto; /* Otomatik genişlik */
        margin-left: 0; /* Sabit pozisyonu kaldır */
        justify-content: center;
        margin-top: 5px;
    }
    #volume-bar {
        width: 50px;
    }
    #playlist-toggle-btn {
        order: 4; /* Volume control'den önce gelsin */
        margin-left: 0;
        margin-top: 5px;
    }

    .player-playlist {
        max-height: 150px; /* Mobil için daha az yer kaplasın */
        padding: 8px 12px;
    }
    .player-playlist h4 {
        font-size: 0.95em;
    }
    .playlist-item {
        padding: 6px 0;
    }
    .playlist-title {
        font-size: 0.9em;
    }
    .playlist-artist {
        font-size: 0.7em;
    }

    .mini-player-icon {
        bottom: 15px;
        left: 15px;
        width: 45px;
        height: 45px;
        font-size: 1.4em;
    }

    body.player-active {
        padding-bottom: 230px; /* Mobil player'ın yeni yüksekliğine göre ayarlandı */
    }
    body.player-minimized {
        padding-bottom: 60px;
    }
}

@media (max-width: 480px) {
    /* Daha küçük mobil ekranlar için ek ayarlar */
    .player-content {
        gap: 5px;
        padding: 5px 10px;
    }
    .player-info {
        
        align-items: center;
        text-align: center;
    }
    .song-details {
        margin-top: 5px;
    }
    .song-title, .song-artist {
        text-align: center; /* Küçük mobil ekranlarda metinleri ortala */
    }
    .player-controls, .volume-control, #playlist-toggle-btn {
        margin-top: 0; /* Boşlukları azalt */
        margin-bottom: 0;
    }
    .volume-control {
        flex-grow: 1; /* Ortaya gelmesi için esnet */
        justify-content: center;
    }
    #playlist-toggle-btn {
        
        text-align: center;
    }

    body.player-active {
        padding-bottom: 250px; /* En küçük ekranlar için padding'i artır */
    }
}