/* Modern CSS Reset and Variables */
:root {
    --primary-color: #00d4ff;
    --secondary-color: #ff6b6b;
    --background-dark: #0a0a12;
    --background-card: rgba(255, 255, 255, 0.08);
    --background-card-hover: rgba(255, 255, 255, 0.12);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-muted: rgba(255, 255, 255, 0.6);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-hover: var(--primary-color);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 12px 40px rgba(0, 212, 255, 0.2);
    --gradient-primary: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    --gradient-secondary: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    --gradient-background: linear-gradient(135deg, #0a0a12 0%, #1a1a2e 50%, #16213e 100%);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --background-dark: #f8fafc;
    --background-card: rgba(0, 0, 0, 0.05);
    --background-card-hover: rgba(0, 0, 0, 0.08);
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.1);
    --gradient-background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #cbd5e0 100%);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, system-ui, sans-serif;
    background: var(--gradient-background);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    font-weight: 400;
    line-height: 1.6;
}

/* Enhanced Header */
header {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Live User Count */
.live-user-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
    animation: pulse-count 3s ease-in-out infinite;
    transition: all 0.3s ease;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 15px;
    font-size: 0.9rem;
    color: #fff;
}

.logout-btn {
    background: #ff4c4c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
}

.logout-btn:hover {
    background: #e03e3e;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.voice-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

.voice-btn.listening {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    animation: pulse-recording 1s ease-in-out infinite;
}

.voice-btn.processing {
    background: linear-gradient(135deg, #ffa726, #ff9800);
    animation: spin 1s linear infinite;
}

@keyframes pulse-recording {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 107, 107, 0);
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.logo-icon {
    font-size: 2rem;
    animation: pulse-glow 2s ease-in-out infinite alternate;
}

.logo-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    font-size: 1.8rem;
    letter-spacing: -0.5px;
}

.theme-btn {
    background: var(--background-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

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

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 0.75rem 2rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border-color);
}

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

.stat-item i {
    color: var(--primary-color);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: var(--background-card);
    border: 1px solid var(--border-color);
}

.connection-status.connected {
    color: #10b981;
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.connection-status.error {
    color: #ef4444;
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.connection-status.connecting {
    color: #f59e0b;
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

/* Enhanced Search Controls */
#main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.search-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i.fa-search {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    z-index: 1;
}

#search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    padding-right: 3rem;
    background: var(--background-card);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    color: var(--text-primary);
    font-size: 1rem;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

#search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
    background: var(--background-card-hover);
}

#search-input::placeholder {
    color: var(--text-muted);
}

#clear-search {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
    opacity: 0;
    pointer-events: none;
}

#clear-search:hover {
    color: var(--primary-color);
    background: var(--background-card);
}

.filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-select {
    background: var(--background-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    min-width: 150px;
    /* Force custom styling over browser defaults */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* Add dropdown arrow */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.6)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.filter-select:hover {
    background: var(--background-card-hover);
    border-color: var(--primary-color);
}

/* Style the dropdown options */
.filter-select option {
    background: var(--background-dark);
    color: var(--text-primary);
    padding: 0.5rem;
    border: none;
}

/* For light theme - only change the arrow color, don't add new background */
[data-theme="light"] .filter-select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(0,0,0,0.6)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

[data-theme="light"] .filter-select option {
    background: var(--background-dark);
    color: var(--text-primary);
}

/* Alternative approach using a custom dropdown wrapper if the above doesn't work */
.custom-select-wrapper {
    position: relative;
    display: inline-block;
}

.custom-select-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-secondary);
    pointer-events: none;
}

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

.favorite-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.favorite-btn.active {
    background: var(--gradient-primary);
}

.hot-btn {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: var(--transition);
}

.hot-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3);
}

.hot-btn.active {
    background: linear-gradient(135deg, #ff4757 0%, #ff3742 100%);
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.4);
}

.hot-ranking-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
    z-index: 2;
    animation: pulse-hot 2s ease-in-out infinite;
}

@keyframes pulse-hot {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 107, 53, 0.5);
    }
    50% {
        box-shadow: 0 0 15px rgba(255, 107, 53, 0.8);
    }
}

.search-stats {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 0.5rem 0;
}

/* Enhanced Channel Grid with Performance Optimizations */
.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
    contain: layout style;
    will-change: transform;
}

.channel-card {
    background: var(--background-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.channel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.channel-card:hover::before {
    left: 100%;
}

.channel-card:hover {
    background: var(--background-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover);
}

.channel-card.active {
    background: rgba(0, 212, 255, 0.15);
    border-color: var(--primary-color);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
}

.channel-card.playing::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    animation: playing-indicator 2s ease-in-out infinite;
}

.channel-number {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--gradient-primary);
    color: white;
    padding: 0.3rem 0.7rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: var(--shadow-card);
}

.channel-number.on-demand {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    animation: pulse-on-demand 2s ease-in-out infinite;
}

.on-demand-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    z-index: 2;
}

@keyframes pulse-on-demand {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 107, 107, 0.5);
    }
    50% {
        box-shadow: 0 0 15px rgba(255, 107, 107, 0.8);
    }
}

.channel-favorite {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--gradient-secondary);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    opacity: 0;
    transition: var(--transition);
}

.channel-card.favorite .channel-favorite {
    opacity: 1;
}

.channel-card img {
    width: 90px;
    height: 90px;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    object-fit: cover;
    transition: var(--transition);
    box-shadow: var(--shadow-card);
}

.channel-card:hover img {
    transform: scale(1.1) rotate(5deg);
}

.channel-card p {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    margin: 0;
}

.channel-genre {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-weight: 400;
}

/* Enhanced Player */
#player {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(30px);
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    bottom: 0;
    z-index: 100;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
    min-height: auto;
}

#player-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
    min-width: 0;
}

.album-art-container {
    position: relative;
}

#player-logo {
    width: 70px;
    height: 70px;
    border-radius: var(--border-radius);
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: var(--shadow-card);
}

.playing-animation {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    gap: 2px;
}

.playing-animation.active {
    display: flex;
}

.playing-animation .bar {
    width: 3px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 2px;
    animation: audio-bars 1s ease-in-out infinite;
}

.playing-animation .bar:nth-child(2) { animation-delay: 0.1s; }
.playing-animation .bar:nth-child(3) { animation-delay: 0.2s; }
.playing-animation .bar:nth-child(4) { animation-delay: 0.3s; }

#player-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

#channel-title {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#player-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0.2rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

#player-artist {
    font-size: 0.95rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-progress {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    width: 0%;
    transition: width 0.1s linear;
}

#track-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 30px;
}

#player-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.control-btn {
    background: var(--background-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.control-btn:hover:not(:disabled) {
    background: var(--background-card-hover);
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

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

.control-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

#play-pause-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: var(--transition);
    flex-shrink: 0;
    box-shadow: var(--shadow-card);
}

#play-pause-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.4);
}

#play-pause-btn:disabled {
    background: var(--background-card);
    cursor: not-allowed;
    opacity: 0.5;
}

#volume-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.volume-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
}

.volume-btn:hover {
    color: var(--primary-color);
}

#volume-slider {
    width: 100px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

#volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

#volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

#volume-value {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 35px;
}

/* Mini Player */
.mini-player {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: var(--background-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    z-index: 1001;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
}

.mini-player.show {
    transform: translateY(0);
    opacity: 1;
}

.mini-player-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#mini-logo {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

.mini-text {
    flex: 1;
    min-width: 0;
}

#mini-title {
    display: block;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#mini-artist {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#mini-play-pause {
    background: var(--gradient-primary);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--background-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-card);
    transform: translateX(300px);
    opacity: 0;
    transition: var(--transition);
    max-width: 300px;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.info {
    border-left: 4px solid var(--primary-color);
}

/* Loading and Error States */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 2rem;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.error-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.error-content {
    text-align: center;
    background: var(--background-card);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--border-radius);
    padding: 3rem;
    max-width: 400px;
    box-shadow: var(--shadow-card);
}

.error-content i {
    font-size: 4rem;
    color: #ef4444;
    margin-bottom: 1.5rem;
}

.error-content h2 {
    margin-bottom: 1rem;
    color: #ef4444;
    font-weight: 700;
}

.error-content p {
    margin-bottom: 2rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.retry-btn {
    background: var(--gradient-secondary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto;
    transition: var(--transition);
    box-shadow: var(--shadow-card);
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.no-results h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 700;
}

.live-user-count:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.live-user-count i {
    font-size: 1rem;
    opacity: 0.9;
}

#user-count-number {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#user-count-label {
    font-size: 0.85rem;
    opacity: 0.9;
}

@keyframes pulse-count {
    0%, 100% {
        box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 2px 15px rgba(102, 126, 234, 0.5);
    }
}

/* Update count animation */
.live-user-count.updated {
    animation: count-update 0.6s ease-out;
}

@keyframes count-update {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
        background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    }
    100% {
        transform: scale(1);
    }
}

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

@keyframes pulse-glow {
    0% {
        text-shadow: 0 0 5px rgba(0, 212, 255, 0.5);
        transform: scale(1);
    }
    100% {
        text-shadow: 0 0 20px rgba(0, 212, 255, 0.8);
        transform: scale(1.05);
    }
}

@keyframes audio-bars {
    0%, 100% { height: 12px; }
    50% { height: 25px; }
}

@keyframes playing-indicator {
    0% { width: 0%; }
    50% { width: 100%; }
    100% { width: 0%; }
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(0, 212, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
    }
}

@keyframes bounce-in {
    0% {
        transform: scale(0.3) translateY(20px);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes slide-up {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.channel-card.new {
    animation: bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.channel-card.active {
    animation: glow-pulse 2s infinite;
}

.stats-bar {
    animation: slide-up 0.8s ease-out;
}

/* Loading states */
.channel-card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Responsive Design */
@media (max-width: 968px) {
    .stats-bar {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .stat-item {
        font-size: 0.8rem;
    }
    
    .search-controls {
        padding: 0 1rem;
    }
    
    .filter-controls {
        justify-content: center;
    }
    
    .channel-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 0.75rem;
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    #main-content {
        padding: 1rem;
        padding-bottom: 120px; /* Add space for compact player */
    }

    .channel-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    #player {
        padding: 0.75rem;
        flex-direction: row;
        gap: 0.75rem;
        height: auto;
        min-height: 70px;
        max-height: 70px;
    }

    #player-info {
        flex-direction: row;
        text-align: left;
        gap: 0.75rem;
        flex: 1;
        min-width: 0;
    }

    #player-logo {
        width: 45px;
        height: 45px;
        flex-shrink: 0;
    }

    #player-text {
        text-align: left;
        flex: 1;
        min-width: 0;
    }

    #channel-title {
        font-size: 0.7rem;
        line-height: 1.2;
    }

    #player-title {
        font-size: 0.9rem;
        line-height: 1.2;
        margin: 0;
    }

    #player-artist {
        font-size: 0.8rem;
        line-height: 1.2;
    }

    .track-progress {
        display: none; /* Hide progress on mobile to save space */
    }

    #player-controls {
        gap: 0.5rem;
        flex-shrink: 0;
    }

    .control-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    #play-pause-btn {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }

    #volume-control {
        display: none;
    }

    /* Hide some secondary controls on mobile */
    #prev-channel,
    #next-channel,
    #share-track {
        display: none;
    }
    
    /* Keep favorites button visible on mobile */
    #favorite-current {
        display: flex !important;
    }

    .mini-player {
        display: none; /* Disable mini player since main player is compact */
    }
}

@media (max-width: 480px) {
    .channel-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
    
    .channel-card {
        padding: 0.75rem;
    }
    
    .channel-card img {
        width: 60px;
        height: 60px;
    }
    
    .search-controls {
        gap: 0.75rem;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-select {
        min-width: unset;
    }

    #main-content {
        padding: 0.75rem;
        padding-bottom: 80px; /* Smaller space for ultra-compact player */
    }

    #player {
        padding: 0.5rem;
        min-height: 60px;
        max-height: 60px;
    }

    #player-logo {
        width: 38px;
        height: 38px;
    }

    #channel-title {
        font-size: 0.65rem;
    }

    #player-title {
        font-size: 0.8rem;
    }

    #player-artist {
        font-size: 0.7rem;
    }

    #play-pause-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .control-btn {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }

    /* Keep favorites button visible even on very small screens */
    #favorite-current {
        display: flex !important;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    #player, .mini-player, .toast-container {
        display: none;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: rgba(255, 255, 255, 0.3);
        --background-card: rgba(255, 255, 255, 0.15);
    }
}
