/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    height: 100vh;
    margin: 0;
    padding: 0;
    color: #333;
    overflow-x: hidden;
    position: relative
}

canvas {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
}

/* Header Styles */
.header {
    background: #000;
    color: white;
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

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

#backgroundCanvas {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

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

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-right: 16px;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.header-center {
    flex: 2;
    display: flex;
    justify-content: center;
}

.header-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.logo-link {
    text-decoration: none;
    display: block;
    transition: opacity 0.3s ease;
}

.logo-link:hover {
    opacity: 0.8;
}

.mdlogo {
    height: 40px;
    width: auto;
}

.social-icons {
    display: flex;
    gap: 16px;
    align-items: center;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
}

.social-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    color: #667eea;
}

.social-icon svg {
    width: 18px;
    height: 18px;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    width: 100%;
    max-width: 300px;
    height: auto;
    max-height: 80vh;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    border-radius: 12px;
    margin: 20px;
}

.mobile-menu-overlay.active .mobile-menu-content {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: flex-end;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-menu-close svg {
    width: 24px;
    height: 24px;
}



.mobile-social {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mobile-social h3 {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
}

.mobile-social-icons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-social-icon {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
}

.mobile-social-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #667eea;
    transform: translateX(4px);
}

.mobile-social-icon svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.mobile-social-icon span {
    font-size: 13px;
    font-weight: 500;
}

/* Main Content */
.player-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100vw;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    box-sizing: border-box;
}

#audioPlayer {width: 80px;height: 80px;position: absolute;z-index: -1;opacity: 0;}
.vjs-loading-spinner{display: none;}
#audioPlayer video {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;

}

.background-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.3;
}

/* News Block Styles */
.news-block {
    margin: 100px auto 0;
    width: 100%;
    max-width: 30vw;
    padding: 20px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: none;
    box-sizing: border-box;
    position: relative;
}

@media (max-width: 1040px) {
    .news-block{
        max-width: 40vw;
    }
}

.news-block:after{
    content:"";
    position: absolute;
    height: 120px;
    display: block;
    width: 1px;
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.news-title {
    font-size: 18px;
    font-weight: 700;
    color: white;
    margin: 0;
}

.refresh-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    color: #999;
}

.refresh-btn:hover {
    background: rgba(216, 49, 54, 0.2);
    color: #d83136;
}

.refresh-btn svg {
    width: 16px;
    height: 16px;
}

.news-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.news-item {
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.news-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}

.news-date {
    color: #ccc;
    font-weight: 500;
}

.news-category {
    color: #d83136;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
}

.news-item-title {
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.news-lead {
    font-size: 12px;
    color: #ccc;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Player Container */
.player-container {
    width: 100%;
}

.player-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
    margin: 0;
    gap: 20px;
    padding: 10px 20px;
    box-sizing: border-box;
}

.player-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.player-right {
    display: flex;
    align-items: center;
}

.player-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(216, 49, 54, 0.1) 0%, rgba(216, 49, 54, 0.05) 100%);
    z-index: -1;
}

/* Player Info */
.player-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    column-gap: 12px;
}


.station-info h1 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.station-status {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Connection Indicator */
.connection-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff4757;
    transition: background-color 0.3s ease;
}

.connection-indicator.connected .indicator-dot {
    background: #2ed573;
}

.connection-indicator.connected .indicator-text {
    color: #2ed573;
}

.indicator-text {
    color: #ff4757;
    transition: color 0.3s ease;
}

/* Player Controls */
.player-controls {
    display: flex;
    justify-content: center;
}

/* Stream Status Indicator */
.stream-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.stream-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff4757;
    transition: background-color 0.3s ease;
}

.stream-status.connected .stream-status-dot {
    background: #2ed573;
}

.stream-status-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.play-button {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #d83136 0%, #b91c1c 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(216, 49, 54, 0.3);
    position: relative;
    overflow: hidden;
}

.play-button:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(216, 49, 54, 0.4);
}

.play-button:active {
    transform: scale(0.95);
}

.play-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.play-icon,
.pause-icon {
    width: 26px;
    height: 26px;
    fill: currentColor;
    transition: all 0.3s ease;
}

/* Loading Spinner */
.loading-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px;
}

.volume-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.volume-button:hover {
    background: rgba(102, 126, 234, 0.1);
}

.volume-icon,
.volume-muted-icon {
    width: 18px;
    height: 18px;
    fill: #666;
    transition: fill 0.3s ease;
}

.volume-button:hover .volume-icon,
.volume-button:hover .volume-muted-icon {
    fill: #667eea;
}

.volume-slider {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: #e1e5e9;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #d83136;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #d83136;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.volume-slider::-moz-range-thumb:hover {
    background: #b91c1c;
    transform: scale(1.2);
}

.volume-value {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    min-width: 28px;
    text-align: right;
}



/* Error Message */
.error-message {
    text-align: center;
    padding: 24px;
    background: rgba(255, 71, 87, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 71, 87, 0.2);
    margin-top: 16px;
}

.error-message p {
    color: #ff4757;
    margin-bottom: 16px;
    font-weight: 500;
}

.retry-button {
    background: #ff4757;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-button:hover {
    background: #ff3838;
    transform: translateY(-1px);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .social-icons {
        display: none;
    }
    
    .header-content {
        padding: 0 16px;
        height: 50px;
    }
    
    .mdlogo {
        height: 32px;
    }
    
    /* Hide player title on mobile */
    .player-info {
        display: none;
    }
    
    /* Stream status indicator */
    .stream-status {
        display: flex;
        align-items: center;
        gap: 8px;
        color: white;
        font-size: 12px;
        font-weight: 500;
    }
    
    .stream-status-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #ff4757;
        transition: background-color 0.3s ease;
    }
    
    .stream-status.connected .stream-status-dot {
        background: #2ed573;
    }
    
    .stream-status-text {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 80px;
    }
    
    /* Show only volume icon on mobile */
    .volume-control {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 0 8px;
    }
    
    .volume-slider {
        display: none;
    }
    
    .volume-value {
        display: none;
    }
    
    .player-wrapper {
        gap: 12px;
        padding: 10px;
    }
    
    .news-block {
        margin-top: 70px;
        padding: 16px;
        max-width: 100%;
    }
    
    
    .news-content {
        grid-template-columns: 1fr;
        gap: 16px;
        max-width: 100%;
        margin: 0;
    }
    
    .news-title {
        font-size: 16px;
    }
    
    .news-item {
        padding: 10px;
    }
    
    .news-item-title {
        font-size: 13px;
    }
    
    .news-lead {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0 12px;
        height: 50px;
    }
    
    .mdlogo {
        height: 28px;
    }
    
    .mobile-menu-toggle {
        width: 26px;
        height: 20px;
        margin-right: 12px;
    }
    
    .hamburger-line {
        height: 2px;
    }
    
    .player-container {
        padding: 8px 12px;
    }
    
    .player-wrapper {
        gap: 8px;
        padding: 0 8px;
    }
    
    .play-button {
        width: 48px;
        height: 48px;
    }
    
    .play-icon,
    .pause-icon {
        width: 20px;
        height: 20px;
    }
    
    .volume-button {
        padding: 6px;
    }
    
    .volume-icon,
    .volume-muted-icon {
        width: 16px;
        height: 16px;
    }
    
    .stream-status {
        font-size: 11px;
    }
    
    .stream-status-text {
        max-width: 60px;
    }
}
    
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .header-content {
        height: 45px;
    }
    
    .mdlogo {
        height: 28px;
    }
    
    .mobile-menu-toggle {
        width: 24px;
        height: 18px;
    }
    
    .hamburger-line {
        height: 2px;
    }
    

    .player-wrapper {
        padding: 20px 16px;
    }
    
    .news-block {
        padding-bottom: 160px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .play-button {
        box-shadow: 0 8px 24px rgba(102, 126, 234, 0.25);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    }
    
    .player-wrapper {
        background: rgba(45, 55, 72, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .station-info h1 {
        color: #f7fafc;
    }
    
    .station-status {
        color: #a0aec0;
    }
    
    .volume-icon,
    .volume-muted-icon {
        fill: #a0aec0;
    }
    
    .volume-button:hover .volume-icon,
.volume-button:hover .volume-muted-icon {
    fill: #d83136;
}
    
    .volume-value {
        color: #a0aec0;
    }
    
    .player-stats {
        display: none;
        color: #718096;
    }
    
    .volume-slider {
        background: #4a5568;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .play-button:hover {
        transform: none;
    }
    
    .volume-slider::-webkit-slider-thumb:hover,
    .volume-slider::-moz-range-thumb:hover {
        transform: none;
    }
}

/* Focus States for Accessibility */
.play-button:focus-visible,
.volume-button:focus-visible,
.retry-button:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.volume-slider:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 4px;
}