/*
 * Kolhakfar Radio Player Styles
 * RTL and Hebrew optimized
 */

.kolhakfar-radio-player {
    direction: rtl;
    font-family: 'Heebo', 'Arial', sans-serif;
    background: transparent;
    border-radius: 0;
    padding: 15px;
    color: #ffffff;
    box-shadow: none;
    position: relative;
    overflow: hidden;
    width: 100%;
    margin: 0;
    max-width: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kolhakfar-radio-player::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.02"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    pointer-events: none;
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.player-logo {
    display: none !important;
}

.player-logo .microphone-icon {
    width: 40px;
    height: 40px;
    background: #ffd700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
    font-size: 20px;
}

.player-title {
    font-size: 24px;
    font-weight: bold;
    color: #ffffff;
    margin: 0;
}

.player-subtitle {
    font-size: 14px;
    color: #cccccc;
    margin: 0;
}

.player-controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    padding: 8px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.control-btn.popout {
    background: rgba(255, 215, 0, 0.2);
}

.control-btn.popout:hover {
    background: rgba(255, 215, 0, 0.3);
}

.player-main {
    position: relative;
    z-index: 2;
}

.now-playing {
    text-align: center;
    margin-bottom: 20px;
}

.song-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffd700;
    margin: 0 0 5px 0;
    min-height: 22px;
}

.song-artist {
    font-size: 14px;
    color: #cccccc;
    margin: 0;
    min-height: 18px;
}

.waveform-container {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    background: transparent;
    border-radius: 0;
    padding: 0;
    overflow: hidden;
    width: 100%;
}

.waveform-container {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    background: transparent;
    border-radius: 0;
    padding: 0;
    overflow: hidden;
    flex: 1;
}

.waveform {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2px;
    height: 100%;
    width: 100%;
    padding: 0 10px;
}

.waveform-bar {
    flex: 1;
    background: linear-gradient(to top, #ffffff, #f0f0f0);
    border-radius: 2px;
    animation: wave 1.5s ease-in-out infinite;
    animation-play-state: running;
    opacity: 0.8;
    min-width: 3px;
    max-width: 10px;
    height: 30%;
    transition: all 0.3s ease;
}

.player-paused .waveform-bar {
    animation-play-state: paused;
}

.waveform-bar:nth-child(1) { animation-delay: 0s; height: 20%; }
.waveform-bar:nth-child(2) { animation-delay: 0.1s; height: 40%; }
.waveform-bar:nth-child(3) { animation-delay: 0.2s; height: 60%; }
.waveform-bar:nth-child(4) { animation-delay: 0.3s; height: 80%; }
.waveform-bar:nth-child(5) { animation-delay: 0.4s; height: 100%; }
.waveform-bar:nth-child(6) { animation-delay: 0.5s; height: 80%; }
.waveform-bar:nth-child(7) { animation-delay: 0.6s; height: 60%; }
.waveform-bar:nth-child(8) { animation-delay: 0.7s; height: 40%; }
.waveform-bar:nth-child(9) { animation-delay: 0.8s; height: 20%; }
.waveform-bar:nth-child(10) { animation-delay: 0.9s; height: 30%; }
.waveform-bar:nth-child(11) { animation-delay: 1s; height: 50%; }
.waveform-bar:nth-child(12) { animation-delay: 1.1s; height: 70%; }
.waveform-bar:nth-child(13) { animation-delay: 1.2s; height: 90%; }
.waveform-bar:nth-child(14) { animation-delay: 1.3s; height: 70%; }
.waveform-bar:nth-child(15) { animation-delay: 1.4s; height: 50%; }
.waveform-bar:nth-child(16) { animation-delay: 0.2s; height: 35%; }
.waveform-bar:nth-child(17) { animation-delay: 0.6s; height: 65%; }
.waveform-bar:nth-child(18) { animation-delay: 1.0s; height: 85%; }
.waveform-bar:nth-child(19) { animation-delay: 0.4s; height: 45%; }
.waveform-bar:nth-child(20) { animation-delay: 0.8s; height: 75%; }
.waveform-bar:nth-child(21) { animation-delay: 1.2s; height: 55%; }
.waveform-bar:nth-child(22) { animation-delay: 0.3s; height: 25%; }
.waveform-bar:nth-child(23) { animation-delay: 0.7s; height: 95%; }
.waveform-bar:nth-child(24) { animation-delay: 1.1s; height: 65%; }
.waveform-bar:nth-child(25) { animation-delay: 0.5s; height: 35%; }
.waveform-bar:nth-child(26) { animation-delay: 0.9s; height: 85%; }
.waveform-bar:nth-child(27) { animation-delay: 1.3s; height: 45%; }
.waveform-bar:nth-child(28) { animation-delay: 0.1s; height: 75%; }
.waveform-bar:nth-child(29) { animation-delay: 1.4s; height: 55%; }
.waveform-bar:nth-child(30) { animation-delay: 0.6s; height: 25%; }

@keyframes wave {
    0%, 100% { 
        transform: scaleY(0.3); 
        opacity: 0.6; 
    }
    25% { 
        transform: scaleY(0.8); 
        opacity: 0.9; 
    }
    50% { 
        transform: scaleY(1.2); 
        opacity: 1; 
    }
    75% { 
        transform: scaleY(0.6); 
        opacity: 0.8; 
    }
}



.radio-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0;
    background: transparent;
}

.radio-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.radio-metadata {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    background: transparent;
}

.current-song {
    font-size: 18px;
    font-weight: 600;
    color: #ffd700;
    margin: 0 0 5px 0;
    min-height: 22px;
}

.song-artist {
    font-size: 14px;
    color: #cccccc;
    margin: 0;
    min-height: 18px;
}

.play-pause-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ffed4e) !important;
    border: none !important;
    color: #1a1a1a !important;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3) !important;
    position: relative;
    flex-shrink: 0;
}

.play-pause-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.play-pause-btn .play-icon,
.play-pause-btn .pause-icon {
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popout-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
}

.popout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.volume-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    direction: rtl;
    margin-top: 10px;
    width: 100%;
}

.volume-slider {
    width: 100px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
    direction: rtl;
    transform: scaleX(-1);
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffd700;
    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: #ffd700;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.player-status,
.status-indicator,
.listeners-count {
    display: none !important;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 5px;
    background: #ff4444;
    animation: pulse 2s infinite;
}

.status-indicator.live {
    background: #44ff44;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .kolhakfar-radio-player {
        margin: 10px;
        padding: 15px;
    }
    
    .player-title {
        font-size: 20px;
    }
    
    .song-title {
        font-size: 16px;
    }
    
    .player-controls-main {
        gap: 15px;
    }
    
    /* Mobile layout: waveform beside play/pause button */
    .radio-controls {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 15px !important;
        width: 100% !important;
        margin: 0 !important;
    }
    
    .play-pause-btn {
        flex-shrink: 0 !important;
        width: 50px !important;
        height: 50px !important;
        order: 2 !important;
    }
    
    .waveform-container {
        flex: 1 !important;
        height: 50px !important;
        min-width: 0 !important;
        margin: 0 !important;
        order: 1 !important;
        display: flex !important;
    }
    
    .waveform {
        height: 100% !important;
        padding: 0 5px !important;
        width: 100% !important;
    }
    
    .waveform-bar {
        max-width: 8px !important;
        min-width: 2px !important;
    }
    
    .volume-control {
        flex-direction: column;
        gap: 5px;
        margin-top: 15px;
    }
    
    .volume-slider {
        width: 80px;
    }
    
    .control-btn, .dock-btn {
        width: 35px !important;
        height: 35px !important;
        font-size: 14px !important;
    }
    
    .popout-btn {
        width: 35px;
        height: 35px !important;
    }
    
    /* Docked player mobile styles */
    .kolhakfar-docked-player {
        padding: 8px 15px;
    }
    
    .docked-player-content {
        gap: 10px;
    }
    
    .docked-player-logo {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .docked-current-song {
        font-size: 13px;
    }
    
    .docked-station-name {
        font-size: 11px;
    }
    
    .docked-play-btn {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .docked-volume-slider {
        width: 60px;
    }
    
    .docked-control-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .kolhakfar-radio-player {
        margin: 5px;
        padding: 10px;
    }
    
    .radio-controls {
        gap: 8px;
    }
    
    .play-pause-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .waveform-container {
        height: 30px;
    }
    
    .volume-slider {
        width: 60px;
    }
    
    .control-btn, .dock-btn {
        width: 30px !important;
        height: 30px !important;
        font-size: 12px !important;
    }
    
    .popout-btn {
        width: 30px;
        height: 30px !important;
    }
    
    /* Docked player small mobile styles */
    .docked-player-content {
        gap: 8px;
    }
    
    .docked-player-logo {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .docked-current-song {
        font-size: 12px;
    }
    
    .docked-station-name {
        font-size: 10px;
    }
    
    .docked-play-btn {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .docked-volume-slider {
        width: 50px;
    }
    
    .docked-control-btn {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
}

/* Popup Window Styles */
.radio-player-popup {
    width: 400px;
    height: 300px;
    background: #1a1a1a;
    border: none;
    border-radius: 15px;
    overflow: hidden;
}

.radio-player-popup .kolhakfar-radio-player {
    height: 100%;
    width: 100%;
    margin: 0;
    border-radius: 0;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.radio-player-popup .kolhakfar-radio-player::before {
    border-radius: 0;
}

.radio-player-popup .radio-controls {
    justify-content: center;
    gap: 20px;
}

.radio-player-popup .play-pause-btn {
    width: 60px;
    height: 60px;
    font-size: 24px;
}

.radio-player-popup .waveform-container {
    height: 50px;
}

.radio-player-popup .volume-control {
    justify-content: center;
    margin-top: 20px;
}

.radio-player-popup .volume-slider {
    width: 150px;
}

.radio-player-popup .current-song {
    font-size: 20px;
    margin-bottom: 10px;
}

.radio-player-popup .player-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Dock Button Styles */
.dock-btn {
    background: none !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 8px !important;
    color: #ffffff !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-size: 16px !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0.8 !important;
}

.dock-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    opacity: 1 !important;
    transform: translateY(-2px) !important;
}

/* Docked Player Styles */
.kolhakfar-docked-player {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%) !important;
    border-top: 2px solid #ffd700 !important;
    padding: 10px 20px !important;
    z-index: 999999 !important;
    direction: rtl !important;
    font-family: 'Heebo', 'Arial', sans-serif !important;
    color: #ffffff !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(10px) !important;
    transform: translateY(100%) !important;
    transition: transform 0.3s ease-in-out !important;
    width: 100% !important;
    min-height: 60px !important;
}

.kolhakfar-docked-player.show {
    transform: translateY(0) !important;
}

.docked-player-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    gap: 15px;
}

.docked-player-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 0;
    max-width: none;
}

.docked-player-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ffd700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
    font-weight: bold;
    font-size: 18px;
    flex-shrink: 0;
}

.docked-player-metadata {
    flex: 1;
    min-width: 0;
}

.docked-current-song {
    font-size: 14px;
    font-weight: 600;
    color: #ffd700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.docked-station-name {
    font-size: 12px;
    color: #cccccc;
    margin: 0;
}

.docked-player-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-grow: 1;
    min-width: 0;
}

.docked-play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    border: none;
    color: #1a1a1a;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.docked-play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.docked-volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.docked-volume-slider {
    width: 80px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
    direction: rtl;
    transform: scaleX(-1);
}

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

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

.docked-control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    padding: 6px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

.docked-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

.docked-close-btn {
    background: rgba(255, 0, 0, 0.2);
}

.docked-close-btn:hover {
    background: rgba(255, 0, 0, 0.4);
}

/* Episode Progress Controls */
.docked-progress-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex: 1;
    min-width: 100px;
    max-width: none;
    margin: 0 10px;
    flex-grow: 1;
    flex-shrink: 1;
}

.docked-progress-slider {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.docked-progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffd700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.docked-progress-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(255, 215, 0, 0.4);
}

.docked-progress-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffd700;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Episode Control Buttons */
.docked-control-btn {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 6px;
    padding: 6px;
    color: #ffd700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.docked-control-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: #ffd700;
    transform: translateY(-1px);
}

#docked-live-btn {
    background: rgba(255, 215, 0, 0.9);
    color: #1a1a1a;
    font-weight: bold;
    font-size: 10px;
    width: 40px;
}

#docked-live-btn:hover {
    background: #ffd700;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

/* AJAX Loading Overlay */
.ajax-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ajax-loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.ajax-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 215, 0, 0.3);
    border-top: 4px solid #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffd700;
    animation: spin 1s ease-in-out infinite;
}

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

/* Error State */
.error-state {
    color: #ff6b6b;
    text-align: center;
    padding: 20px;
}

.error-state .error-icon {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
}

/* Paused State */
.player-paused .waveform {
    opacity: 0.7;
}

.player-paused .waveform-bar {
    animation-play-state: paused;
}

/* Hebrew Font Support */
@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;500;600;700&display=swap');

.kolhakfar-radio-player * {
    font-family: 'Heebo', 'Arial', sans-serif;
}