@charset "utf-8";

/* ============================================================
   1. VARIABLES & PLYR BRANDING OVERRIDES
   ============================================================ */
:root {
    --plyr-color-main: #009444; 
    --plyr-audio-control-color: #ffffff;
}

.plyr--audio input[type=range] { color: #009444 !important; }
.plyr--audio .plyr__time { color: #ffffff; font-size: 12px; }
.plyr--audio .plyr__controls { background: transparent !important; border-radius: 16px !important; }

/* ============================================================
   2. MAIN PLAYER LAYOUT & CONTAINERS
   ============================================================ */
.player-container, .playlist-container {
    max-width: 650px;
    width: 100%;
    margin: 30px auto;
}

.player-container {
    margin-top: 20px;
    border-radius: 8px;
}

#player-border {
    background-color: #3a6c85;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%23ffffff' fill-opacity='0.09' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");
    padding: 25px;
    border-radius: 24px;
    border: rgba(0,0,0,0.1) solid 1px;
}

.current-song-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
    position: relative;
    width: 100%; 
}

/* ============================================================
   3. TYPOGRAPHY & TEXT
   ============================================================ */
#player-border h2, 
#player-border h3, 
#player-border p,
#player-border .song-details * {
    color: #ffffff !important;
}

.song-details { color: white; flex: 1; }
.song-details h2 { font-size: 18pt; margin: 0; font-weight: 700; }
.song-details h3 { font-size: 13pt; margin: 5px 0; font-style: italic; opacity: 0.9; }
.song-details p { font-size: 11pt; line-height: 1.4; margin-top: 10px; }

/* ============================================================
   4. ARTWORK & LOADING STATES
   ============================================================ */
#current-cover {
    width: 100% !important; 
    max-width: 100% !important;
    height: auto !important; 
    object-fit: cover !important; 
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    display: block;
    margin: 0 auto;
}

.is-loading #current-cover {
    filter: brightness(0.7);
    transition: 0.3s;
}

.is-loading .current-song-info::after {
    content: "";
    position: absolute;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: #009444;
    border-radius: 50%;
    left: 50%;
    top: 50%;
    margin-left: -20px;
    margin-top: -20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Desktop Image & Flex Rules (Kicks in at 601px) */
@media (min-width: 601px) {
    .current-song-info { 
        flex-direction: row; 
        text-align: left; 
    }
    #current-cover {
        width: 250px !important; 
        min-width: 250px !important;
        max-width: 250px !important;
    }
}

/* ============================================================
   5. PLAYLIST
   ============================================================ */
.playlist-container {
    background-color: #1e262a;
    max-height: 400px;
    overflow-y: auto;
    border-radius: 24px;
}

#playlist { list-style: none; padding: 10px 0; margin: 0; }

.playlist-item {
    display: flex;
    align-items: center;
    padding: 12px 10%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: 0.2s;
}

.playlist-item.active { background-color: #009444; }

.playlist-item img {
    width: 50px !important;
    height: 50px !important;
    object-fit: cover !important;
    border-radius: 8px;
    margin-right: 20px;
}

.playlist-item .song-title { color: white; font-weight: 600; margin: 0; }
.playlist-item .song-artist { color: rgba(255,255,255,0.7); font-size: 0.9em; margin: 0; }

/* ============================================================
   6. MOBILE RESPONSIVENESS (< 450px)
   ============================================================ */
@media (max-width: 450px) {
    #player-border {
        padding: 15px 12px !important;
        border-radius: 18px !important;
    }

    .plyr__volume {
        display: none !important;
    }

    .plyr--audio .plyr__controls {
        padding: 5px 2px !important;
        gap: 5px !important;
    }

    .plyr__time {
        font-size: 10px !important;
        min-width: auto !important;
        padding: 0 2px !important;
    }

    .song-details h2 { font-size: 1.2rem !important; }
    .song-details h3 { font-size: 1rem !important; }
    .song-details p { font-size: 0.9rem !important; line-height: 1.3; }

    .playlist-item {
        padding: 10px 5% !important;
    }
    .playlist-item img {
        width: 40px !important;
        height: 40px !important;
        margin-right: 12px !important;
    }
}