@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap');

:root {
    --primary: #6c5ce7;
    --secondary: #a29bfe;
    --background: #1a1a2e;
    --surface: #16213e;
    --text: #ffffff;
    --text-secondary: #a0a0a0;
    --shadow: rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    max-width: 1000px;
    width: 100%;
    padding: 1rem;
}

h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    font-size: 2rem;
}

.player {
    background-color: var(--surface);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tabs {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.tab-btn {
    flex: 1;
    background-color: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.selection-area {
    position: relative;
    height: 400px; /* Increased height */
    overflow: hidden; /* Changed from overflow-y: auto */
}

.country-list, .station-list {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding-right: 5px; /* Added padding for scrollbar */
    overflow-y: auto; /* Moved overflow to individual lists */
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    visibility: hidden; /* Added visibility */
}

.country-list.active, .station-list.active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible; /* Added visibility */
}

.country-btn, .station-btn {
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text);
    padding: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: 'Inter', sans-serif;
    text-align: left;
}

.country-btn i, .station-btn i {
    font-size: 1.25rem;
    color: var(--secondary);
}

.country-btn:hover, .station-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.country-btn.active, .station-btn.active {
    background-color: var(--primary);
}

.country-btn.active i, .station-btn.active i {
    color: var(--text);
}

.playback-area {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 1.25rem;
}

#nowPlaying {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.now-playing-icon {
    font-size: 1.75rem;
    color: var(--primary);
}

.now-playing-info {
    display: flex;
    flex-direction: column;
}

.now-playing-info .country {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.now-playing-info .station {
    font-size: 1.1rem;
    font-weight: 600;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control-btn {
    background-color: var(--primary);
    border: none;
    color: var(--text);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
}

.control-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(108, 92, 231, 0.6);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text);
}

#volumeSlider {
    -webkit-appearance: none;
    width: 120px;
    height: 4px;
    border-radius: 2px;
    background: var(--secondary);
    outline: none;
}

#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid var(--text);
}

#volumeSlider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid var(--text);
}

#volumePercentage {
    min-width: 40px;
    text-align: right;
}

/* Scrollbar styling */
.country-list::-webkit-scrollbar,
.station-list::-webkit-scrollbar {
    width: 5px;
}

.country-list::-webkit-scrollbar-track,
.station-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.country-list::-webkit-scrollbar-thumb,
.station-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

@media (min-width: 768px) {
    .container {
        padding: 2rem;
    }

    h1 {
        font-size: 2.5rem;
    }

    .player {
        padding: 2rem;
    }

    .tabs {
        display: none;
    }

    .selection-area {
        height: auto;
        overflow: visible;
        display: flex;
        gap: 2rem;
    }

    .country-list, .station-list {
        position: static;
        height: auto;
        max-height: 500px; /* Added max-height for desktop */
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
        flex: 1;
    }
}

