/* =========================================================
   GHOSTLIB MUSIC PLAYER
   FRUTIGER AERO // WEB 1.0 // CRT // CLUNKY MODE
========================================================= */

.music-player {
    width: 100%;
    max-width: 560px;
    margin: 20px auto;
    padding: 10px;

    background:
        linear-gradient(
            to bottom,
            #d9ffff 0%,
            #8bdde0 7%,
            #4d9ca7 8%,
            #176273 45%,
            #0b3947 100%
        );

    border: 3px ridge #d8ffff;

    box-shadow:
        4px 4px 0 #174d59,
        7px 7px 0 rgba(0, 50, 70, .35);

    font-family:
        "Courier New",
        monospace;

    color: #063f43;
}


/* =========================================================
   VISUALIZER WINDOW
========================================================= */

.visualizer-wrap {
    position: relative;

    width: 100%;
    height: 155px;

    overflow: hidden;

    background:
        linear-gradient(
            to bottom,
            #063c50 0%,
            #062c3c 50%,
            #041d2b 100%
        );

    border:
        4px inset #a6e8e5;

    box-shadow:
        inset 0 0 0 2px #174d59,
        inset 0 0 25px rgba(0, 255, 220, .18);

    image-rendering: pixelated;
}


/* =========================================================
   CANVAS
========================================================= */

#music-visualizer {
    display: block;

    width: 100%;
    height: 100%;

    image-rendering: pixelated;
}


/* =========================================================
   CRT SCANLINES
========================================================= */

.visualizer-wrap::before {
    content: "";

    position: absolute;
    inset: 0;

    pointer-events: none;

    z-index: 3;

    background:
        repeating-linear-gradient(
            to bottom,
            rgba(255,255,255,.04) 0px,
            rgba(255,255,255,.04) 1px,
            transparent 1px,
            transparent 4px
        );
}


/* =========================================================
   VISUALIZER TOP LABEL
========================================================= */

.visualizer-overlay {
    position: absolute;

    top: 6px;
    left: 8px;
    right: 8px;

    z-index: 4;

    display: flex;
    justify-content: space-between;

    pointer-events: none;

    font-size: 8px;
    font-weight: bold;
    letter-spacing: 1px;

    color: #cffff8;

    text-shadow:
        1px 1px 0 #06313b;
}

#visualizer-status {
    color: #fff36a;
}


/* =========================================================
   SONG SCREEN
========================================================= */

.player-screen {
    margin-top: 8px;

    min-height: 48px;

    padding: 8px;

    display: flex;
    flex-direction: column;
    justify-content: center;

    text-align: center;

    background:
        linear-gradient(
            to bottom,
            #092d35,
            #041b22
        );

    border:
        3px inset #8bb9bd;

    box-shadow:
        inset 0 0 0 1px #06313b;

    color: #9ffff0;

    text-shadow:
        1px 1px 0 #06313b;
}

.player-label {
    display: block;

    margin-bottom: 4px;

    color: #77c8c5;

    font-size: 8px;
    font-weight: bold;

    letter-spacing: 2px;
}

#main-song-title {
    display: block;

    overflow: hidden;

    white-space: nowrap;
    text-overflow: ellipsis;

    color: #fff56b;

    font-size: 13px;
}


/* =========================================================
   REAL PROGRESS BAR
========================================================= */

.music-progress {
    position: relative;

    width: 100%;
    height: 14px;

    margin-top: 10px;

    overflow: hidden;

    cursor: pointer;

    background:
        repeating-linear-gradient(
            90deg,
            #08242b 0px,
            #08242b 4px,
            #0d3037 4px,
            #0d3037 8px
        );

    border:
        3px inset #a8d5d3;

    box-shadow:
        inset 0 0 0 1px #052027;
}


/*
   JavaScript controla el width.
   NO poner animation aquí.
*/

.music-progress-bar {
    width: 0%;
    height: 100%;

    min-width: 0;

    background:
        repeating-linear-gradient(
            90deg,
            #fff36a 0px,
            #fff36a 5px,
            #70e87d 5px,
            #70e87d 10px,
            #35c9d4 10px,
            #35c9d4 15px
        );

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.65),
        0 0 4px rgba(50, 240, 220, .7);

    transition:
        width .08s linear;
}


/* =========================================================
   SIDEBAR PROGRESS
========================================================= */

.sidebar-progress {
    height: 9px;

    margin-top: 10px;
}

.sidebar-progress .music-progress-bar {
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.5);
}


/* =========================================================
   TIME
========================================================= */

.player-time {
    display: flex;

    justify-content: space-between;

    margin-top: 3px;

    color: #4d7d83;

    font-size: 8px;
    font-weight: bold;
}


/* =========================================================
   CONTROLS
========================================================= */

.player-controls {
    display: flex;

    justify-content: center;
    align-items: center;

    gap: 6px;

    margin-top: 10px;
}

.player-controls button {
    min-width: 43px;
    min-height: 28px;

    padding: 3px 9px;

    border:
        3px outset #d7eeee;

    border-radius: 2px;

    background:
        linear-gradient(
            to bottom,
            #e8ffff 0%,
            #a4d7d9 45%,
            #579ba4 46%,
            #37727d 100%
        );

    color: #063d47;

    font-family:
        "Courier New",
        monospace;

    font-size: 12px;
    font-weight: bold;

    cursor: pointer;

    box-shadow:
        2px 2px 0 #173f48;
}

.player-controls button:hover {
    background:
        linear-gradient(
            to bottom,
            #fffca5,
            #ffe94d 50%,
            #d7a91e
        );

    color: #533e00;
}

.player-controls button:active {
    border-style: inset;

    transform:
        translate(2px, 2px);

    box-shadow: none;
}


/* =========================================================
   PLAY BUTTON
========================================================= */

.player-controls .play-button {
    width: 52px;
    height: 34px;

    background:
        linear-gradient(
            to bottom,
            #ffffb0,
            #ffe94b 45%,
            #c8a319
        );

    color: #4e4200;

    border-color: #fffde0;
}

.player-controls .play-button:hover {
    background:
        linear-gradient(
            to bottom,
            #ffffff,
            #fff36c 45%,
            #e0b92a
        );
}


/* =========================================================
   VOLUME
========================================================= */

.volume-control {
    display: flex;

    align-items: center;

    gap: 8px;

    margin-top: 9px;

    color: #276d75;

    font-size: 9px;
    font-weight: bold;
}

.volume-control input {
    flex: 1;

    height: 8px;

    cursor: pointer;

    accent-color: #2ebfc5;
}


/* =========================================================
   PLAYING EFFECT
========================================================= */

.music-player.playing .player-screen {
    border-color: #d9ffff;

    box-shadow:
        inset 0 0 8px rgba(100,255,230,.18);
}

.music-player.playing .visualizer-wrap {
    box-shadow:
        inset 0 0 0 2px #174d59,
        inset 0 0 25px rgba(0,255,220,.25);
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 500px) {

    .music-player {
        padding: 7px;

        box-shadow:
            3px 3px 0 #174d59;
    }

    .visualizer-wrap {
        height: 125px;
    }

    .player-controls {
        gap: 4px;
    }

    .player-controls button {
        min-width: 37px;

        padding:
            4px 6px;
    }

    .player-controls .play-button {
        width: 48px;
    }
}

/* =========================================================
   NOW PLAYING - ALBUM ART
========================================================= */

.album {
    display: flex;
    align-items: center;
    gap: 10px;
}


/* PORTADA */

.album-art {
    flex-shrink: 0;

    width: 64px;
    height: 64px;

    overflow: hidden;

    background:
        linear-gradient(
            135deg,
            #8de8e5,
            #237c91
        );

    border:
        3px ridge #d9ffff;

    box-shadow:
        3px 3px 0 #174d59;

    image-rendering: pixelated;
}


/* IMAGEN */

.album-art img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    image-rendering: auto;
}


/* FALLBACK VISUAL */

.album-art:has(img[src=""]) {
    background:
        repeating-linear-gradient(
            45deg,
            #164c5b 0px,
            #164c5b 5px,
            #237285 5px,
            #237285 10px
        );
}


/* SONG INFO */

.song-info {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 4px;
}

.song-info strong {
    overflow: hidden;

    white-space: nowrap;
    text-overflow: ellipsis;

    color: #fff36a;

    font-size: 11px;

    text-shadow:
        1px 1px 0 #16434d;
}

.song-info span {
    color: #72b8b9;

    font-size: 8px;

    letter-spacing: 1px;
}