* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Modern Color Palette */
    --bg-primary: #0f0f1e;
    --bg-secondary: #1a1a2e;
    --bg-sidebar: #16182a;
    --accent-primary: #ff6b35;
    --accent-secondary: #f7931e;
    --accent-gradient: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b7b;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --hover-bg: rgba(255, 107, 53, 0.1);
    --active-bg: rgba(255, 107, 53, 0.15);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ==================== HEADER ==================== */
.app-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-logo {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.app-title {
    font-size: 1.25rem;
    font-weight: 600;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    display: flex;
    align-items: center;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 20px;
    color: #ef4444;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* ==================== LOADING & ERROR STATES ==================== */
.loading-state,
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 80px);
    gap: 1rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-state svg {
    color: #f87171;
}

.retry-btn {
    margin-top: 1rem;
    padding: 0.75rem 2rem;
    background: var(--accent-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

/* ==================== APP BODY ==================== */
.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: 400px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    background: var(--glass-bg);
    padding: 0.25rem;
    border-radius: 12px;
}

.sidebar-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-tab:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.sidebar-tab.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.sidebar-tab svg {
    width: 18px;
    height: 18px;
}

.search-container {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(255, 107, 53, 0.05);
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* ==================== CHANNELS LIST ==================== */
.channels-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.channel-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem;
    background: var(--glass-bg);
    border: 1px solid transparent;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.channel-item:hover {
    background: var(--hover-bg);
    border-color: var(--glass-border);
    transform: translateX(3px);
}

.channel-item.active {
    background: var(--active-bg);
    border-color: var(--accent-primary);
}

.channel-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent-gradient);
    border-radius: 0 3px 3px 0;
}

.channel-item-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.25rem;
    flex-shrink: 0;
}

.channel-item-info {
    flex: 1;
    min-width: 0;
}

.channel-item-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-item-type {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.channel-item.active .channel-item-name {
    color: var(--accent-primary);
    font-weight: 600;
}

.now-playing-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 107, 53, 0.2);
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.now-playing-badge .pulse-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
}

/* Scrollbar */
.channels-list::-webkit-scrollbar {
    width: 6px;
}

.channels-list::-webkit-scrollbar-track {
    background: transparent;
}

.channels-list::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 3px;
}

.channels-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==================== PLAYER AREA ==================== */
.player-area {
    flex: 1;
    background: var(--bg-primary);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Welcome State */
.welcome-state {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.welcome-content {
    text-align: center;
    max-width: 500px;
}

.welcome-content svg {
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
    opacity: 0.6;
}

.welcome-content h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Player Container */
.player-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.5rem;
}

.player-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.video-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: relative;
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-js {
    width: 100%;
    height: 100%;
}

.video-js .vjs-tech {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.35);
    z-index: 5;
}

.video-loading-overlay .spinner {
    width: 44px;
    height: 44px;
}

.video-loading-text {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Audio Player Visual */
.audio-player-visual {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a2e;
    position: relative;
    overflow: hidden;
}

.audio-player-visual::before {
    content: '';
    position: absolute;
    inset: -20px; /* Extend slightly to avoid blur edges */
    background-image: var(--bg-image);
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    filter: blur(30px);
    opacity: 0.5;
    z-index: 0;
}

.radio-visual {
    position: relative;
    width: 320px;
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.radio-logo-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(50px);
    opacity: 0.25;
    border-radius: 50%;
}

.radio-logo {
    width: 100%;
    max-width: 300px;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6);
    position: relative;
    z-index: 1;
    background: var(--glass-bg);
    padding: 10px;
    border: 3px solid rgba(255, 107, 53, 0.3);
}

.audio-visualizer {
    position: absolute;
    bottom: -60px;
    display: flex;
    gap: 5px;
    align-items: flex-end;
    height: 50px;
}

.audio-visualizer .bar {
    width: 5px;
    background: var(--accent-gradient);
    border-radius: 3px;
    animation: visualize 0.8s ease-in-out infinite;
}

.audio-visualizer .bar:nth-child(1) {
    animation-delay: 0s;
}

.audio-visualizer .bar:nth-child(2) {
    animation-delay: 0.1s;
}

.audio-visualizer .bar:nth-child(3) {
    animation-delay: 0.2s;
}

.audio-visualizer .bar:nth-child(4) {
    animation-delay: 0.3s;
}

.audio-visualizer .bar:nth-child(5) {
    animation-delay: 0.4s;
}

@keyframes visualize {

    0%,
    100% {
        height: 12px;
    }

    50% {
        height: 40px;
    }
}

/* Player Info */
.player-info {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
}

.player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.channel-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.channel-logo {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.5rem;
}

.channel-details h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.channel-type {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background: var(--accent-gradient);
    border-radius: 6px;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.player-controls {
    display: flex;
    align-items: center;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: 0.75rem;
}

.volume-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.volume-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: scale(1.05);
}

.volume-range {
    width: 120px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.volume-range:focus {
    outline: none;
}

.play-btn-large {
    width: 64px;
    height: 64px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
}

.play-btn-large:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(255, 107, 53, 0.6);
}

.channel-description {
    margin-bottom: 1.25rem;
}

.channel-description h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.channel-description p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.channel-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.link-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.link-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: var(--accent-primary);
}

.link-btn.whatsapp {
    background: rgba(37, 211, 102, 0.1);
    border-color: rgba(37, 211, 102, 0.3);
    color: #25d366;
}

.link-btn.whatsapp:hover {
    background: rgba(37, 211, 102, 0.2);
    border-color: #25d366;
}

/* Player Area Scrollbar */
.player-area::-webkit-scrollbar {
    width: 8px;
}

.player-area::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.player-area::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

.player-area::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==================== RESPONSIVE ==================== */

/* Tablets and smaller screens - Sidebar moves below content */
@media (max-width: 999px) {
    /* Allow full page scrolling on mobile */
    body, 
    .app-container {
        height: auto;
        overflow: visible;
    }

    .app-body {
        flex-direction: column;
        overflow: visible;
        height: auto;
    }

    .sidebar {
        width: 100%;
        max-height: none;
        border-right: none;
        border-top: 1px solid var(--glass-border);
        order: 2;
        /* Move sidebar below player */
        overflow: visible;
    }

    .player-area {
        order: 1;
        /* Keep player on top */
        min-height: auto;
        overflow: visible;
        height: auto;
    }

    .channels-list {
        max-height: none;
        overflow: visible;
    }

    .player-container {
        padding: 1rem;
        gap: 1rem;
    }

    .video-container {
        max-height: 60vh;
    }

    .player-info {
        padding: 1rem;
    }

    .channel-details h2 {
        font-size: 1.5rem;
    }

    .channel-logo {
        width: 60px;
        height: 60px;
    }

    .play-btn-large {
        width: 56px;
        height: 56px;
    }

    .radio-visual {
        width: 280px;
        height: 280px;
    }

    .radio-logo {
        width: 180px;
        height: 180px;
    }

    /* Hide channel info (logo/name) on mobile, only show controls */
    .player-header {
        flex-direction: row;
        justify-content: center;
        padding: 0.5rem 0;
    }

    .channel-info {
        display: none;
    }

    .player-controls {
        width: 100%;
        justify-content: center;
        gap: 2rem;
    }

    .volume-range {
        width: 90px;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        /*   width: 260px;*/
    }

    .channel-item-name {
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .app-title {
        font-size: 1rem;
    }

    .sidebar {
        /* width: 220px;*/
    }

    .channel-item {
        padding: 0.75rem;
    }

    .channel-item-logo {
        width: 40px;
        height: 40px;
    }

    .player-container {
        padding: 1rem;
    }
}
