:root {
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --secondary: #ec4899;
    --dark-bg: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.6);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Dynamic background */
.background-animation {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.15) 0%, transparent 40%);
    animation: rotateBg 30s linear infinite;
    z-index: -1;
}

@keyframes rotateBg {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.app-container {
    width: 100%;
    max-width: 900px;
    padding: 2rem;
    z-index: 1;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #c084fc, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    text-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
}

.header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Player Section */
.player-section {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.now-playing {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.station-logo {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.3);
    transition: transform 0.3s ease;
}

.station-logo.playing {
    animation: pulseLogo 2s infinite ease-in-out;
}

@keyframes pulseLogo {
    0% { transform: scale(1); box-shadow: 0 10px 20px rgba(139, 92, 246, 0.3); }
    50% { transform: scale(1.05); box-shadow: 0 15px 30px rgba(236, 72, 153, 0.4); }
    100% { transform: scale(1); box-shadow: 0 10px 20px rgba(139, 92, 246, 0.3); }
}

.station-info h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.station-info p {
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
}

/* Visualizer */
.visualizer {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    height: 60px;
    margin-bottom: 2rem;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.visualizer.active {
    opacity: 1;
}

.bar {
    width: 8px;
    background: linear-gradient(to top, var(--primary), var(--secondary));
    border-radius: 4px;
    height: 10px;
    transition: height 0.1s ease;
}

.visualizer.active .bar {
    animation: bounceBar 1s infinite alternate ease-in-out;
}

.visualizer.active .bar:nth-child(1) { animation-delay: 0.1s; }
.visualizer.active .bar:nth-child(2) { animation-delay: 0.3s; }
.visualizer.active .bar:nth-child(3) { animation-delay: 0.0s; }
.visualizer.active .bar:nth-child(4) { animation-delay: 0.4s; }
.visualizer.active .bar:nth-child(5) { animation-delay: 0.2s; }
.visualizer.active .bar:nth-child(6) { animation-delay: 0.5s; }
.visualizer.active .bar:nth-child(7) { animation-delay: 0.1s; }

@keyframes bounceBar {
    0% { height: 10px; }
    100% { height: 100%; }
}

/* Controls */
.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

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

.control-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 0 1rem;
}

.volume-control i {
    color: var(--text-muted);
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px var(--primary);
}

/* Stations Grid */
.stations-list {
    max-height: 550px;
    overflow-y: auto;
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1.5rem;
    align-content: start;
}

/* Scrollbar styling */
.stations-list::-webkit-scrollbar {
    width: 8px;
}
.stations-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}
.stations-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
.stations-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.station-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    text-align: center;
}

.station-item:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 35px 0 rgba(0, 0, 0, 0.4);
}

.station-item.active {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.3);
    transform: translateY(-4px);
}

.station-item-icon {
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
    position: relative;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2), inset 0 0 0 1px rgba(0,0,0,0.05);
    padding: 10px;
    transition: all 0.3s ease;
}

.station-item-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
}

/* Hover play overlay */
.station-item-icon::after {
    content: '\f04b'; /* Play */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    color: #ffffff;
    border-radius: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    opacity: 0;
    transition: all 0.3s ease;
}

.station-item:hover .station-item-icon::after {
    opacity: 1;
}

.station-item.active .station-item-icon::after {
    content: '\f028'; /* Volume */
    opacity: 1;
    background: rgba(139, 92, 246, 0.85);
    animation: pulseActive 2s infinite;
}

@keyframes pulseActive {
    0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(139, 92, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}

.station-item-info h3 {
    font-size: 1rem;
    color: var(--text-main);
    font-weight: 600;
    margin-bottom: 0;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.5px;
}

.station-item-info p {
    display: none;
}

.playing-indicator {
    display: none !important;
}
