/* ===== VARIABLES ===== */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-bg: #111827;
    --card-bg: #1f2937;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --border-color: #374151;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
}

/* ===== BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== HEADER ===== */
.header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.logo i {
    color: var(--primary-color);
    font-size: 1.8rem;
}

.logo .brand {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--error-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: var(--success-color);
}

.active-listeners {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

/* ===== MAIN CONTENT ===== */
.main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* ===== PLAYER SECTION ===== */
.player-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 3rem;
    border: 1px solid var(--border-color);
    text-align: center;
}

.station-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.station-icon {
    width: 80px;
    height: 80px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: var(--shadow-lg);
}

.station-info h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.station-info p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.control-btn {
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
    font-size: 1.2rem;
}

.control-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.play-btn {
    background: var(--primary-color);
    border-color: var(--primary-color);
    width: 70px;
    height: 70px;
    font-size: 1.4rem;
}

.play-btn:hover {
    background: var(--primary-hover);
}

.volume-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    max-width: 300px;
    margin: 0 auto;
}

#volume-slider {
    flex: 1;
    height: 6px;
    background: var(--border-color);
    outline: none;
    border-radius: 3px;
    -webkit-appearance: none;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

#volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

#volume-value {
    color: var(--text-secondary);
    font-size: 0.9rem;
    min-width: 40px;
}

/* ===== STATIONS SECTION ===== */
.stations-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 2rem;
    text-align: center;
}

.stations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.station-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: var(--transition);
    cursor: pointer;
}

.station-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.station-card.active {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
}

.station-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.station-logo {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
}

.station-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.live-indicator {
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.station-body {
    text-align: center;
}

.station-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.station-genre {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.select-btn {
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.select-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.station-card.active .select-btn {
    background: var(--success-color);
}

.station-card.active .select-btn i {
    animation: pulse 1s infinite;
}

/* ===== INFO SECTION ===== */
.info-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.info-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.info-item i {
    font-size: 2rem;
    color: var(--primary-color);
}

.info-item span {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== NOTIFICATIONS ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: slideIn 0.3s ease;
    max-width: 350px;
}

.notification.error {
    background: var(--error-color);
}

.notification.success {
    background: var(--success-color);
}

.notification.warning {
    background: var(--warning-color);
}

/* ===== ANIMATIONS ===== */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .main {
        padding: 1rem;
    }
    
    .station-display {
        flex-direction: column;
        gap: 1rem;
    }
    
    .station-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .station-info h2 {
        font-size: 1.5rem;
    }
    
    .player-controls {
        gap: 0.5rem;
    }
    
    .control-btn {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
    
    .play-btn {
        width: 60px;
        height: 60px;
        font-size: 1.2rem;
    }
    
    .stations-grid {
        grid-template-columns: 1fr;
    }
    
    .info-content {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0 1rem;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .logo i {
        font-size: 1.5rem;
    }
    
    .logo .brand {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .station-card {
        padding: 1rem;
    }
    
    .volume-control {
        max-width: 250px;
    }
}

/* ===== LOADING STATES ===== */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* FOCUS STYLES */
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* HIGH CONTRAST MODE */
@media (prefers-contrast: high) {
    :root {
        --border-color: #ffffff;
        --text-secondary: #ffffff;
    }
}