* {
    box-sizing: border-box;
}

html {
    /* Reserve the scrollbar gutter so fixed UI does not shift sideways
       when a page becomes tall enough to scroll. */
    scrollbar-gutter: stable;
}


/* =========================================================
   BASE
========================================================= */

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #181818;
    color: #eeeeee;
}


/* =========================================================
   MAIN SIDEBAR
========================================================= */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;

    width: 220px;
    height: 100vh;

    background: #111111;

    padding: 25px 15px;
}

.sidebar h1 {
    margin-top: 0;
    margin-bottom: 30px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar a {
    color: #cccccc;
    text-decoration: none;

    padding: 12px;

    border-radius: 6px;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.sidebar a:hover,
.sidebar a.active {
    background: #2b2b2b;
    color: white;
}

.sidebar .home-link {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.sidebar .home-link small {
    color: #777777;
    font-size: 0.68rem;
    font-weight: normal;
}

.sidebar .home-link.active small,
.sidebar .home-link:hover small {
    color: #aaaaaa;
}

.under-construction {
    color: #999999;
    font-size: 1rem;
}


/* =========================================================
   PAGE CONTENT
========================================================= */

.content {
    margin-left: 220px;
    padding: 40px;
    padding-bottom: 110px;

    min-height: 100vh;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.radio-header {
    margin-bottom: 25px;
}


/* =========================================================
   EQUALIZER PLAYER
========================================================= */

.equalizer-widget {
    display: flex;
    align-items: center;

    gap: 16px;

    margin-top: 30px;

    padding: 16px 18px;

    background: #111111;

    border: 1px solid #333333;
    border-radius: 10px;

    width: 100%;
    max-width: 460px;
}

.equalizer {
    display: flex;
    align-items: flex-end;

    gap: 5px;

    width: 50px;
    height: 34px;

    flex-shrink: 0;
}

.eq-bar {
    width: 6px;

    background: #4fd1c5;
    border-radius: 3px;

    height: 6px;

    animation: eq-bounce 1.1s ease-in-out infinite;
    animation-play-state: paused;
}

.eq-bar:nth-child(1) { animation-duration: 0.9s;  animation-delay: 0s;    }
.eq-bar:nth-child(2) { animation-duration: 1.2s;  animation-delay: 0.15s; }
.eq-bar:nth-child(3) { animation-duration: 0.8s;  animation-delay: 0.05s; }
.eq-bar:nth-child(4) { animation-duration: 1.3s;  animation-delay: 0.2s;  }
.eq-bar:nth-child(5) { animation-duration: 1s;    animation-delay: 0.1s;  }

.equalizer-widget.playing .eq-bar,
.equalizer.playing .eq-bar {
    animation-play-state: running;
}

@keyframes eq-bounce {
    0%, 100% { height: 6px;  }
    50%      { height: 32px; }
}

.equalizer-copy {
    min-width: 0;
    flex: 1;
}

.equalizer-label {
    color: #eeeeee;
    font-size: 0.92rem;
    font-weight: bold;

    display: flex;
    align-items: center;
    gap: 8px;

    margin-bottom: 4px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.equalizer-status {
    color: #999999;
    font-size: 0.82rem;
}

.inline-flag {
    border-radius: 2px;
    vertical-align: middle;
    flex-shrink: 0;
}

.play-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    flex: 0 0 42px;

    background: #242424;
    color: #eeeeee;

    border: 1px solid #383838;
    border-radius: 50%;

    font-size: 1rem;

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        opacity 0.15s ease,
        transform 0.15s ease;
}

.play-toggle-btn:hover:not(:disabled) {
    background: #2d2d2d;
    border-color: #555555;
    transform: scale(1.04);
}

.play-toggle-btn:disabled {
    opacity: 0.4;
    cursor: default;
}


/* =========================================================
   RADIO BROWSER
========================================================= */

.radio-browser {
    display: grid;

    grid-template-columns:
        260px minmax(0, 1fr);

    gap: 18px;

    align-items: stretch;

    min-height: 650px;
}


/* =========================================================
   GENRES
========================================================= */

.genre-panel {
    background: #111111;

    border: 1px solid #333333;
    border-radius: 8px;

    padding: 14px;

    min-height: 650px;
    max-height: calc(100vh - 150px);

    overflow-y: auto;
}


#genre-list {
    display: flex;
    flex-direction: column;

    gap: 12px;
}


.genre-button {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    background: #242424;
    color: #cccccc;

    border: 1px solid #383838;
    border-radius: 7px;

    padding: 15px 14px;

    cursor: pointer;

    text-align: left;
    font-size: 0.95rem;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}


.genre-button:hover {
    background: #2d2d2d;
    border-color: #555555;
    color: #ffffff;
}


.genre-button.active {
    background: #353535;
    border-color: #777777;
    color: #ffffff;
}


.genre-count {
    color: #777777;
    font-size: 0.8rem;
    flex-shrink: 0;
}


.genre-button.active .genre-count {
    color: #bbbbbb;
}


/* Genre scrollbar */

.genre-panel::-webkit-scrollbar {
    width: 7px;
}

.genre-panel::-webkit-scrollbar-track {
    background: transparent;
}

.genre-panel::-webkit-scrollbar-thumb {
    background: #444444;
    border-radius: 10px;
}


/* =========================================================
   STATIONS
========================================================= */

.station-panel {
    min-width: 0;
    min-height: 650px;

    background: #111111;

    border: 1px solid #333333;
    border-radius: 8px;

    padding: 22px;
}


#genre-title {
    margin: 0 0 20px;

    padding-bottom: 12px;

    border-bottom: 1px solid #333333;

    font-size: 1.3rem;
}


/*
   Important:
   stations are vertical rows instead of a card grid.
*/

.station-grid {
    display: flex;
    flex-direction: column;

    gap: 14px;
}


/* Individual station */

.station-button {
    display: grid;

    grid-template-columns:
        44px minmax(0, 1fr);

    align-items: center;

    gap: 14px;

    width: 100%;
    max-width: 850px;

    min-height: 78px;

    padding: 15px 18px;

    background: #242424;
    color: #eeeeee;

    border: 1px solid #383838;
    border-radius: 7px;

    cursor: pointer;

    text-align: left;

    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}


.station-button:hover {
    background: #2d2d2d;
    border-color: #555555;
}


.station-button.playing {
    background: #353535;
    border-color: #888888;
}


/* Flag */

.station-flag {
    width: 24px;
    height: 18px;

    object-fit: cover;
    border-radius: 3px;

    justify-self: center;
    align-self: center;
}


/* Station text */

.station-name {
    display: block;

    font-size: 1rem;
    font-weight: bold;

    margin-bottom: 5px;
}


.station-description {
    display: block;

    color: #999999;

    font-size: 0.84rem;
    line-height: 1.35;
}

/* =========================================================
   PLAYER
========================================================= */

.player-panel {
    position: fixed;

    /* Anchored to the viewport corner. Combined with the stable
       scrollbar gutter above, this position does not jump when
       the vertical scrollbar appears or disappears. */
    right: 20px;
    bottom: 20px;

    margin: 0;

    width: 460px;
    max-width: calc(100% - 280px);

    z-index: 1000;

    box-shadow:
        0 10px 35px rgba(0, 0, 0, 0.4);
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1000px) {

    .radio-browser {
    grid-template-columns:
        220px minmax(0, 1fr);

        gap: 14px;
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 750px) {

    .sidebar {
        position: static;

        width: 100%;
        height: auto;

        padding: 15px;
    }


    .sidebar h1 {
        margin-bottom: 15px;
    }


    .sidebar nav {
        flex-direction: row;
    }


    .content {
        margin-left: 0;

        padding: 20px;
    }


    .radio-browser {
        display: block;
    }


    /*
        On mobile genres become a horizontal row.
    */

    .genre-panel {
        position: static;

        max-height: none;

        overflow-x: auto;
        overflow-y: hidden;

        margin-bottom: 20px;

        padding: 7px;
    }


    #genre-list {
        flex-direction: row;

        width: max-content;
    }


    .genre-button {
        width: auto;

        min-width: max-content;

        white-space: nowrap;
    }


    .genre-count {
        margin-left: 4px;
    }


    .station-button {
    	max-width: none;
    }


    .player-panel {
        left: 12px;
        right: 12px;
        bottom: 12px;

        width: auto;
        max-width: none;
    }

}