/* Modern CSS Reset and Variables */
:root {
    --primary-color: #8b5cf6;
    --secondary-color: #3b82f6;
    --accent-gold: #f59e0b;
    --accent-silver: #9ca3af;
    --background-dark: #0f172a;
    --background-card: rgba(30, 41, 59, 0.6);
    --background-card-hover: rgba(51, 65, 85, 0.8);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(139, 92, 246, 0.5);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 12px 40px rgba(139, 92, 246, 0.25);
    --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%);
    --gradient-secondary: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    --gradient-gold: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --gradient-background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #172554 100%);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --background-dark: #f8fafc;
    --background-card: rgba(255, 255, 255, 0.7);
    --background-card-hover: rgba(255, 255, 255, 0.95);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: rgba(0, 0, 0, 0.05);
    --shadow-card: 0 8px 32px rgba(148, 163, 184, 0.15);
    --gradient-background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 50%, #cbd5e1 100%);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 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;
    position: relative;
    background-attachment: fixed;
}

h1,
h2,
h3,
h4,
h5,
h6,
.logo-text,
#player-title,
.channel-number {
    font-family: 'Outfit', sans-serif;
}


body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(0, 212, 255, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(102, 126, 234, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 107, 107, 0.03) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
    animation: ambient-glow 8s ease-in-out infinite alternate;
}

@keyframes ambient-glow {
    0% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

/* Enhanced Header */
header {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08) 0%, rgba(13, 17, 23, 0.95) 50%, rgba(102, 126, 234, 0.08) 100%);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    touch-action: pan-y pinch-zoom;
}

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

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

.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;
    filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.4));
}

.logo-text {
    background: linear-gradient(135deg, #00d4ff 0%, #667eea 50%, #ff6b6b 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    font-size: 1.8rem;
    letter-spacing: -0.5px;
    animation: gradient-shift 4s ease infinite;
    text-shadow: none;
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.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;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-select option {
    background: var(--background-dark);
    color: var(--text-primary);
    padding: 0.5rem;
    border: none;
}

.filter-select option:hover {
    background: var(--background-card-hover);
}

.filter-select option:checked {
    background: var(--primary-color);
    color: white;
}

.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(200px, 1fr));
    gap: 2rem;
    padding: 2rem 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: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.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.6s;
}

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

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

.channel-card.active {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--primary-color);
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.3);
}

@keyframes card-glow {
    0% {
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
    }

    100% {
        box-shadow: 0 0 30px rgba(139, 92, 246, 0.4);
    }
}

.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-gold);
    color: #1a1a2e;
    padding: 0.3rem 0.7rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    animation: number-shimmer 3s ease-in-out infinite;
}

@keyframes number-shimmer {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    }

    50% {
        box-shadow: 0 4px 20px rgba(255, 215, 0, 0.7);
    }
}

.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(15, 23, 42, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 32px 32px 0 0;
    padding: 1.5rem 3rem;
    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.4);
    min-height: auto;
    transition: all 0.3s ease;
    max-width: 1400px;
    margin: 0 auto;
}

#player:hover {
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 -15px 50px rgba(139, 92, 246, 0.15), 0 -8px 30px rgba(0, 0, 0, 0.5);
}

/* Fullscreen Player Styles */
#player.fullscreen,
#player.simulated-fullscreen {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: linear-gradient(135deg,
            rgba(0, 10, 18, 0.98) 0%,
            rgba(26, 26, 46, 0.98) 25%,
            rgba(22, 33, 62, 0.98) 50%,
            rgba(16, 21, 35, 0.98) 75%,
            rgba(0, 10, 18, 0.98) 100%);
    backdrop-filter: blur(50px);
    border: none;
    box-shadow: 0 0 100px rgba(0, 212, 255, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    cursor: default;
    animation: fullscreen-enter 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    text-align: center;

    /* Mobile-first approach */
    padding: 1rem;
}

@keyframes fullscreen-enter {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

#player.fullscreen #player-info,
#player.simulated-fullscreen #player-info {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
    max-width: 600px;
    margin: 0 auto 3rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

#player.fullscreen #player-logo,
#player.simulated-fullscreen #player-logo {
    width: min(60vw, 300px);
    height: min(60vw, 300px);
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(0, 212, 255, 0.2);
    margin: 0 auto 1.5rem auto;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.1);
    max-width: 300px;
    max-height: 300px;
    display: block;
}

#player.fullscreen #player-logo:hover,
#player.simulated-fullscreen #player-logo:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.7),
        0 0 80px rgba(0, 212, 255, 0.4);
}

#player.fullscreen #player-text,
#player.simulated-fullscreen #player-text {
    text-align: center;
    max-width: 800px;
}

#player.fullscreen #channel-title,
#player.simulated-fullscreen #channel-title {
    font-size: clamp(0.9rem, 3vw, 1.3rem);
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
    text-align: center;
}

#player.fullscreen #player-title,
#player.simulated-fullscreen #player-title {
    font-size: clamp(1.8rem, 6vw, 3rem);
    font-weight: 900;
    margin: 1rem 0;
    line-height: 1.2;
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 50%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
    animation: title-glow 3s ease-in-out infinite alternate;
    text-align: center;
    padding: 0 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

#player.fullscreen #player-artist,
#player.simulated-fullscreen #player-artist {
    font-size: clamp(1.2rem, 4vw, 2rem);
    font-weight: 300;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    opacity: 0.9;
    text-align: center;
    padding: 0 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

#player.fullscreen .track-progress,
#player.simulated-fullscreen .track-progress {
    width: 100%;
    max-width: 500px;
    margin: 2rem auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#player.fullscreen .progress-bar {
    height: 6px;
    border-radius: 3px;
}

#player.fullscreen #track-time {
    font-size: 1rem;
    margin-top: 1rem;
}

#player.fullscreen #player-controls,
#player.simulated-fullscreen #player-controls {
    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: clamp(1rem, 4vw, 2rem);
    margin: 2rem auto 0 auto;
    width: 100%;
    max-width: 800px;
}

#player.fullscreen .control-btn,
#player.simulated-fullscreen .control-btn {
    width: clamp(50px, 10vw, 70px);
    height: clamp(50px, 10vw, 70px);
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

#player.fullscreen #play-pause-btn,
#player.simulated-fullscreen #play-pause-btn {
    width: clamp(70px, 14vw, 100px);
    height: clamp(70px, 14vw, 100px);
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    background: var(--gradient-primary);
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.4);
    min-width: 64px;
    min-height: 64px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    order: 0;
}

#player.fullscreen #play-pause-btn:hover,
#player.simulated-fullscreen #play-pause-btn:hover,
#player.fullscreen #play-pause-btn:active,
#player.simulated-fullscreen #play-pause-btn:active {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(0, 212, 255, 0.6);
}

/* Arrange buttons in optimal order around the play button */
#player.fullscreen #prev-channel,
#player.simulated-fullscreen #prev-channel {
    order: -2;
}

#player.fullscreen #next-channel,
#player.simulated-fullscreen #next-channel {
    order: 2;
}

#player.fullscreen #favorite-current,
#player.simulated-fullscreen #favorite-current {
    order: -1;
}

#player.fullscreen #share-track,
#player.simulated-fullscreen #share-track {
    order: 1;
}

#player.fullscreen #volume-control,
#player.simulated-fullscreen #volume-control {
    display: flex !important;
    flex-direction: row;
    gap: clamp(1rem, 3vw, 1.5rem);
    align-items: center;
    justify-content: center;
    margin: 2rem auto 0 auto;
    width: 100%;
    max-width: 400px;
}

#player.fullscreen #volume-slider,
#player.simulated-fullscreen #volume-slider {
    width: clamp(180px, 50vw, 250px);
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    touch-action: manipulation;
}

#player.fullscreen #volume-slider::-webkit-slider-thumb,
#player.simulated-fullscreen #volume-slider::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
}

#player.fullscreen #volume-slider::-moz-range-thumb,
#player.simulated-fullscreen #volume-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
    border-radius: 50%;
    border: none;
}

#player.fullscreen #volume-value,
#player.simulated-fullscreen #volume-value {
    font-size: clamp(1rem, 3vw, 1.2rem);
    font-weight: 600;
    min-width: 45px;
    text-align: center;
}

#player.fullscreen .playing-animation,
#player.simulated-fullscreen .playing-animation {
    bottom: -15px;
    transform: translateX(-50%) scale(2);
}

#player.fullscreen .playing-animation .bar,
#player.simulated-fullscreen .playing-animation .bar {
    width: 5px;
    height: 25px;
    background: linear-gradient(to top, var(--primary-color), #ffffff);
}

#player.fullscreen .track-progress,
#player.simulated-fullscreen .track-progress {
    width: 100%;
    max-width: 500px;
    margin: 2rem auto;
}

#player.fullscreen .progress-bar,
#player.simulated-fullscreen .progress-bar {
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

#player.fullscreen .progress-fill,
#player.simulated-fullscreen .progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

#player.fullscreen #track-time,
#player.simulated-fullscreen #track-time {
    font-size: 1.2rem;
    margin-top: 1rem;
    font-weight: 600;
}

/* Fullscreen states - no exit transitions for instant response */
#player.fullscreen,
#player.simulated-fullscreen {
    /* Remove transitions for instant fullscreen exit */
}

/* Enhanced background pattern */
#player.fullscreen::after,
#player.simulated-fullscreen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 107, 107, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(0, 212, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

#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: 2px solid rgba(0, 212, 255, 0.3);
    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: 0 0 20px rgba(0, 212, 255, 0.3);
}

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

#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;
    right: 20px;
    background: var(--background-card);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    z-index: 200;
    max-width: 350px;
    transition: var(--transition);
    cursor: pointer;
    opacity: 0;
    transform: translateY(100px);
}

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

.mini-player:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
}

.mini-player:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

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

.mini-logo {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.mini-player-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

#mini-player-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.2rem;
}

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

.mini-player-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.mini-control-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

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

.mini-control-btn:disabled {
    background: var(--background-card);
    cursor: not-allowed;
    opacity: 0.5;
}

.mini-volume-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

.mini-volume-slider {
    width: 60px;
    height: 3px;
    background: var(--border-color);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

.mini-volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.mini-volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Mini player adjustments for mobile */
@media (max-width: 768px) {
    .mini-player {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .mini-player-content {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .mini-logo {
        width: 40px;
        height: 40px;
    }

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

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

    .mini-control-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    .mini-volume-slider {
        width: 50px;
    }
}

@media (max-width: 480px) {
    .mini-volume-control {
        display: none;
        /* Hide volume on very small screens to save space */
    }
}

/* 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 rgba(0, 212, 255, 0.2);
    border-left: 4px solid var(--primary-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

.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 */
.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;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.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);
    }
}

/* Download Track Button */
.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(17, 153, 142, 0.3);
    transition: all 0.3s ease;
    margin-left: 0.5rem;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.5);
    background: linear-gradient(135deg, #0f8a7e 0%, #2dd870 100%);
}

.download-btn:active {
    transform: translateY(0);
}

.download-btn i {
    font-size: 1rem;
}

/* 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));
    }
}

@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.4rem;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

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

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

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

    #volume-slider {
        width: 60px;
    }

    #volume-value {
        display: none;
        /* Hide percentage on mobile to save space */
    }

    .volume-btn {
        font-size: 0.9rem;
    }

    /* Show essential controls on mobile */
    #prev-channel,
    #next-channel,
    #favorite-current {
        display: flex !important;
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    /* Only hide share button on very small screens in regular view */
    #share-track {
        display: none;
    }

    /* Mobile-specific fullscreen improvements */
    #player.fullscreen,
    #player.simulated-fullscreen {
        padding: 1rem 0.5rem;
        height: 100vh;
        height: 100dvh;
        /* Use dynamic viewport height for mobile */
        justify-content: space-between;
        align-items: center;
        flex-direction: column;
        overflow-y: auto;
        /* Allow scrolling if needed */
    }

    #player.fullscreen #player-info,
    #player.simulated-fullscreen #player-info {
        width: 100%;
        max-width: 90vw;
        text-align: center;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        margin-bottom: 2rem;
    }

    #player.fullscreen #player-logo,
    #player.simulated-fullscreen #player-logo {
        width: min(35vw, 160px);
        height: min(35vw, 160px);
        margin-bottom: 1rem;
        border-radius: 15px;
    }

    #player.fullscreen #player-controls,
    #player.simulated-fullscreen #player-controls {
        display: flex !important;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: clamp(0.8rem, 4vw, 1.5rem);
        margin: 2rem auto 1rem auto;
        width: 100%;
        max-width: 95vw;
        padding: 0 1rem;
        box-sizing: border-box;
    }

    /* Arrange buttons in two rows on mobile */
    #player.fullscreen #favorite-current,
    #player.simulated-fullscreen #favorite-current {
        order: 1;
    }

    #player.fullscreen #prev-channel,
    #player.simulated-fullscreen #prev-channel {
        order: 2;
    }

    #player.fullscreen #play-pause-btn,
    #player.simulated-fullscreen #play-pause-btn {
        order: 3;
        width: clamp(70px, 18vw, 90px);
        height: clamp(70px, 18vw, 90px);
        font-size: clamp(1.8rem, 4.5vw, 2.5rem);
        min-width: 70px;
        min-height: 70px;
        background: var(--gradient-primary);
        border: 3px solid rgba(255, 255, 255, 0.4);
        box-shadow: 0 8px 30px rgba(0, 212, 255, 0.4);
        margin: 0 0.5rem;
    }

    #player.fullscreen #next-channel,
    #player.simulated-fullscreen #next-channel {
        order: 4;
    }

    #player.fullscreen #share-track,
    #player.simulated-fullscreen #share-track {
        order: 5;
    }

    #player.fullscreen #volume-control,
    #player.simulated-fullscreen #volume-control {
        display: flex !important;
        flex-direction: row;
        gap: clamp(1rem, 4vw, 1.5rem);
        align-items: center;
        justify-content: center;
        margin: 1.5rem auto 2rem auto;
        width: 100%;
        max-width: 95vw;
        padding: 0 1rem;
        box-sizing: border-box;
    }

    /* Show ALL buttons in fullscreen mobile with consistent sizing */
    #player.fullscreen .control-btn,
    #player.simulated-fullscreen .control-btn,
    #player.fullscreen #prev-channel,
    #player.simulated-fullscreen #prev-channel,
    #player.fullscreen #next-channel,
    #player.simulated-fullscreen #next-channel,
    #player.fullscreen #favorite-current,
    #player.simulated-fullscreen #favorite-current,
    #player.fullscreen #share-track,
    #player.simulated-fullscreen #share-track {
        display: flex !important;
        width: clamp(52px, 14vw, 70px);
        height: clamp(52px, 14vw, 70px);
        font-size: clamp(1.2rem, 3vw, 1.6rem);
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.15);
        border: 2px solid rgba(255, 255, 255, 0.3);
        backdrop-filter: blur(20px);
        color: white;
        cursor: pointer;
        touch-action: manipulation;
        transition: all 0.3s ease;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        min-width: 52px;
        min-height: 52px;
        margin: 0.25rem;
    }

    #player.fullscreen #volume-slider,
    #player.simulated-fullscreen #volume-slider {
        width: clamp(180px, 50vw, 250px);
        height: 10px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 5px;
        outline: none;
        cursor: pointer;
        touch-action: manipulation;
    }

    #player.fullscreen #volume-slider::-webkit-slider-thumb,
    #player.simulated-fullscreen #volume-slider::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
        background: var(--primary-color);
        box-shadow: 0 0 15px rgba(0, 212, 255, 0.6);
        border-radius: 50%;
        cursor: pointer;
        -webkit-appearance: none;
    }

    #player.fullscreen #volume-slider::-moz-range-thumb,
    #player.simulated-fullscreen #volume-slider::-moz-range-thumb {
        width: 24px;
        height: 24px;
        background: var(--primary-color);
        box-shadow: 0 0 15px rgba(0, 212, 255, 0.6);
        border-radius: 50%;
        border: none;
        cursor: pointer;
    }

    #player.fullscreen .volume-btn,
    #player.simulated-fullscreen .volume-btn {
        width: clamp(50px, 12vw, 65px);
        height: clamp(50px, 12vw, 65px);
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.15);
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-radius: 50%;
        color: white;
        font-size: clamp(1.1rem, 2.8vw, 1.4rem);
        cursor: pointer;
        touch-action: manipulation;
        min-width: 50px;
        min-height: 50px;
    }

    #player.fullscreen #volume-value,
    #player.simulated-fullscreen #volume-value {
        display: block !important;
        font-size: clamp(1.1rem, 2.5vw, 1.3rem);
        font-weight: 600;
        min-width: 50px;
        text-align: center;
        color: white;
    }
}

@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: 70px;
        /* Space for 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 essential buttons visible even on very small screens */
    #favorite-current,
    #prev-channel,
    #next-channel {
        display: flex !important;
    }

    /* Show share button in fullscreen on small screens */
    #player.fullscreen #share-track,
    #player.simulated-fullscreen #share-track {
        display: flex !important;
    }

    /* Additional mobile fullscreen optimization */
    #player.fullscreen,
    #player.simulated-fullscreen {
        justify-content: space-between;
        padding: 0.5rem;
        flex-direction: column;
    }
}

/* 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;
}

/* Screen reader only content */
.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;
}

/* Enhanced focus styles for better accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
}

/* High contrast focus for better visibility */
button:focus,
input:focus,
select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

/* Skip link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    border-radius: 4px;
    text-decoration: none;
    z-index: 1000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

/* Ensure interactive elements have minimum size */
button,
input[type="range"]::-webkit-slider-thumb,
input[type="range"]::-moz-range-thumb {
    min-height: 44px;
    min-width: 44px;
}

/* Better focus indicators for channel cards */
.channel-card:focus-within {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Improved button states for screen readers */
button[aria-pressed="true"] {
    background: var(--primary-color);
    color: white;
}

/* 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);
    }
}
/* --- CAR MODE UI --- */
body.car-mode { overflow: hidden; }
body.car-mode header { padding: 10px; background: #000; border-bottom: 2px solid #333; }
body.car-mode #search-container, body.car-mode #channel-container, body.car-mode .live-user-count, body.car-mode #volume-control, body.car-mode #download-track-btn, body.car-mode #share-track { display: none !important; }
body.car-mode #player { inset: 0 !important; height: 100vh !important; padding: 20px !important; display: flex !important; flex-direction: column !important; justify-content: center !important; }
body.car-mode #player-info { flex-direction: column !important; align-items: center !important; gap: 30px !important; margin-bottom: 50px !important; }
body.car-mode .album-art-container { width: 300px !important; height: 300px !important; margin: 0 auto !important; }
body.car-mode #player-logo { width: 100% !important; height: 100% !important; border-radius: 20px !important; }
body.car-mode #player-text { text-align: center !important; align-items: center !important; }
body.car-mode #player-title { font-size: 2.5rem !important; margin-bottom: 10px !important; }
body.car-mode #player-artist { font-size: 1.8rem !important; }
body.car-mode #channel-title { font-size: 1.5rem !important; }
body.car-mode #player-controls { justify-content: center !important; gap: 40px !important; }
body.car-mode .control-btn, body.car-mode #play-pause-btn { width: 100px !important; height: 100px !important; font-size: 2.5rem !important; border-radius: 50% !important; }

/* PWA Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-content.pwa-install-modal {
    background: var(--background-card, #2c2c2e);
    color: var(--text-primary, #ffffff);
    padding: 2rem;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    text-align: center;
}
