/**
 * Radio Sol Docking Player Styles
 * Modern, responsive docking player for live radio and podcasts
 */

/* Player Container */
.radiosol-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: linear-gradient(to right, #e6e6e6, #dddddd);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--e-global-color-primary);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideUp 0.5s ease-out forwards;
    min-height: 80px;
    overflow: hidden;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.radiosol-player.hidden {
    transform: translateY(100%);
}

/* Player Content */
.player-content {
    padding: 12px 20px;
    max-width: 1250px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    background: transparent;
}

/* Player Modes */
.player-mode {
    display: flex;
    align-items: center;
    gap: 16px;
}

.player-mode-podcast {
    display: none;
}

/* Buttons */
.player-btn {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333333;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
}

.player-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

.player-btn:active {
    transform: scale(0.95);
}

/* Play Button */
.player-btn-play {
    background: linear-gradient(135deg, #ff6b6b, #ff4444);
    width: 56px;
    height: 56px;
    color: #ffffff;
}

.player-btn-play:hover {
    background: linear-gradient(135deg, #ff7b7b, #ff5555);
}

.player-btn-play .icon-pause {
    display: none;
}

.player-btn-play.playing .icon-play {
    display: none;
}

.player-btn-play.playing .icon-pause {
    display: block;
}

/* Skip Buttons */
.player-btn-skip-back,
.player-btn-skip-forward {
    width: 44px;
    height: 44px;
}

.player-btn .skip-text {
    position: absolute;
    bottom: 2px;
    font-size: 10px;
    font-weight: bold;
}

/* Toggle Button */
.player-btn-toggle .icon-video {
    display: none;
}

.player-btn-toggle.video-mode .icon-audio {
    display: none;
}

.player-btn-toggle.video-mode .icon-video {
    display: block;
}

/* Download Button */
.player-btn-download {
    width: 44px;
    height: 44px;
}

/* Player Info */
.player-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player-title {
    font-size: 20px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    direction: rtl;
    text-align: right;
    color: var(--e-global-color-primary);
    font-family: "Katalogue", Sans-serif;
}

.player-status {
    font-size: 13px;
    color: var(--e-global-color-primary);
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 6px;
    direction: rtl;
    text-align: right;
    justify-content: flex-end;
    position: relative;
    z-index: 1;
    font-family: "Open Sans Hebrew", Sans-serif;
}

.player-status .status-text {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-start;
    width: 100%;
    direction: rtl;
    text-align: right;
}

.player-status .status-dot {
    width: 8px;
    height: 8px;
    background: #ff6b6b;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

.player-status .status-label {
    white-space: nowrap;
}

.player-status .current-show-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Audio Visualization Soundbars - Full Width */
.audio-visualization-bars {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: stretch;
    gap: 2px;
    padding: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow: hidden;
}

.audio-visualization-bars.active {
    opacity: 1;
}

.soundbar-bar {
    flex: 1;
    height: 20%;
    min-height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px 2px 0 0;
    transform-origin: bottom;
    animation: soundbarWave 2s ease-in-out infinite;
}

.audio-visualization-bars.active .soundbar-bar {
    animation-play-state: running;
}

.audio-visualization-bars:not(.active) .soundbar-bar {
    animation-play-state: paused;
    height: 4px;
}

/* Staggered animation delays for each bar */
.soundbar-bar:nth-child(1) { animation-delay: 0s; }
.soundbar-bar:nth-child(2) { animation-delay: 0.1s; }
.soundbar-bar:nth-child(3) { animation-delay: 0.2s; }
.soundbar-bar:nth-child(4) { animation-delay: 0.3s; }
.soundbar-bar:nth-child(5) { animation-delay: 0.4s; }
.soundbar-bar:nth-child(6) { animation-delay: 0.5s; }
.soundbar-bar:nth-child(7) { animation-delay: 0.6s; }
.soundbar-bar:nth-child(8) { animation-delay: 0.7s; }
.soundbar-bar:nth-child(9) { animation-delay: 0.8s; }
.soundbar-bar:nth-child(10) { animation-delay: 0.9s; }
.soundbar-bar:nth-child(11) { animation-delay: 1s; }
.soundbar-bar:nth-child(12) { animation-delay: 0.9s; }
.soundbar-bar:nth-child(13) { animation-delay: 0.8s; }
.soundbar-bar:nth-child(14) { animation-delay: 0.7s; }
.soundbar-bar:nth-child(15) { animation-delay: 0.6s; }
.soundbar-bar:nth-child(16) { animation-delay: 0.5s; }
.soundbar-bar:nth-child(17) { animation-delay: 0.4s; }
.soundbar-bar:nth-child(18) { animation-delay: 0.3s; }
.soundbar-bar:nth-child(19) { animation-delay: 0.2s; }
.soundbar-bar:nth-child(20) { animation-delay: 0.1s; }

@keyframes soundbarWave {
    0%, 100% {
        height: 20%;
    }
    50% {
        height: 80%;
    }
}

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

/* Progress Bar (Podcast Mode) */
.player-progress {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.progress-bar {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    position: relative;
    direction: rtl;
}

/* Orange fill for progress - RTL direction (right to left) */
.progress-bar::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: linear-gradient(to left, 
        #ff6644 0%, 
        #ff6644 var(--progress, 0%), 
        rgba(255, 255, 255, 0.2) var(--progress, 0%), 
        rgba(255, 255, 255, 0.2) 100%);
    border-radius: 3px;
}

.progress-bar::-moz-range-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.progress-bar::-moz-range-progress {
    height: 6px;
    background: #ff6644;
    border-radius: 3px;
}

.progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
    margin-top: -4px;
}

.progress-bar::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.progress-bar::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.progress-bar::-moz-range-thumb:hover {
    transform: scale(1.2);
}

/* Time Display */
.player-time {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--e-global-color-primary);
    opacity: 0.8;
    font-variant-numeric: tabular-nums;
}

.time-separator {
    opacity: 0.5;
}

/* Controls Right */
.player-controls-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.05);
    padding: 8px 12px;
    border-radius: 20px;
}

.volume-control svg {
    color: #333333;
    flex-shrink: 0;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 4px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #333333;
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #333333;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

/* Stream Mode Switch */
.stream-mode-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.08);
    padding: 6px;
    border-radius: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.mode-btn {
    background: transparent;
    border: none;
    padding: 10px 16px;
    border-radius: 18px;
    color: #666666;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    min-width: 50px;
    position: relative;
}

.mode-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333333;
    transform: translateY(-1px);
}

.mode-btn.active {
    background: linear-gradient(135deg, #ff6b6b, #ff4444);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
    transform: translateY(-1px);
}

.mode-btn.active:hover {
    background: linear-gradient(135deg, #ff7b7b, #ff5555);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.5);
}

.mode-btn:disabled,
.mode-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.mode-btn:disabled:hover,
.mode-btn[disabled]:hover {
    background: transparent;
    color: #666666;
    transform: none;
}

.mode-btn svg {
    display: block;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.mode-btn.active svg {
    filter: brightness(0) invert(1);
}

/* Video Container */
.video-container {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 0;
    background: rgba(0, 0, 0, 0.98);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.video-container.expanded {
    height: calc((100vw - 0px) * 9 / 16);
    max-height: calc(80vh - 80px);
    opacity: 1;
    bottom: 80px;
    transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.player-video-display {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    opacity: 1;
}

.video-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10001;
}

.video-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Pop-out button - desktop only */
.video-popout-btn {
    position: absolute;
    top: 20px;
    right: 80px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10001;
}

.video-popout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Pop-out button in docked player controls */
.video-popout-btn-docked {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333333;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.video-popout-btn-docked:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

.video-popout-btn-docked:active {
    transform: scale(0.95);
}

.video-popout-btn-docked svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* Hide pop-out button on mobile */
@media (max-width: 768px) {
    .video-popout-btn,
    .video-popout-btn-docked {
        display: none !important;
    }
}

/* Docking player expands when video is active */
.radiosol-player.video-mode {
    height: 80vh;
    z-index: 9999;
    transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.radiosol-player.video-mode .player-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
}

@media (max-width: 768px) {
    .video-container.expanded {
        height: calc((100vw - 0px) * 9 / 16);
        max-height: calc(80vh - 70px);
    }
    
    .radiosol-player.video-mode {
        height: 80vh;
    }
    
    /* Hide volume control on mobile */
    .volume-control {
        display: none;
    }
    
    /* Adjust mode buttons for mobile */
    .mode-btn {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 44px;
    }
    
    .mode-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .player-btn {
        width: 42px;
        height: 42px;
    }

    .player-btn-play {
        width: 50px;
        height: 50px;
    }

    .player-btn-skip-back,
    .player-btn-skip-forward,
    .player-btn-download {
        width: 38px;
        height: 38px;
    }

    .player-btn svg {
        width: 20px;
        height: 20px;
    }

    .player-btn-play svg {
        width: 22px;
        height: 22px;
    }

    .player-title {
        font-size: 14px;
    }

    .player-status {
        font-size: 12px;
    }

    .player-time {
        font-size: 11px;
    }
}

/* Hidden Media Elements */
.player-audio,
.player-video {
    display: none;
}

/* Additional Responsive Rules */
@media (max-width: 480px) {
    .player-content {
        padding: 8px 10px;
    }

    .player-mode {
        gap: 8px;
    }

    .player-btn {
        width: 38px;
        height: 38px;
    }

    .player-btn-play {
        width: 46px;
        height: 46px;
    }

    .player-btn-skip-back,
    .player-btn-skip-forward,
    .player-btn-download {
        width: 36px;
        height: 36px;
    }

    .player-btn svg {
        width: 18px;
        height: 18px;
    }

    .player-btn-play svg {
        width: 20px;
        height: 20px;
    }

    .player-title {
        font-size: 13px;
    }

    .player-status {
        font-size: 11px;
    }
}

/* Accessibility */
.player-btn:focus {
    outline: 2px solid rgba(0, 0, 0, 0.3);
    outline-offset: 2px;
}

.player-btn:focus:not(:focus-visible) {
    outline: none;
}

/* Live Button Sync Styles */
#liveButton.elementor-button-link {
    transition: color 0.3s ease;
}

#liveButton.elementor-button-link .elementor-button-text {
    color: #ffffff;
    transition: color 0.3s ease;
}

#liveButton.elementor-button-link:hover .elementor-button-text {
    color: #ff6644;
}

#liveButton.elementor-button-link:active .elementor-button-text,
#liveButton.elementor-button-link.active .elementor-button-text,
#liveButton.elementor-button-link:focus .elementor-button-text {
    color: #ffffff !important;
}

/* Print Styles */
@media print {
    .radiosol-player {
        display: none;
    }
}

/* Body Padding for Player */
body {
    padding-bottom: 80px;
}

@media (max-width: 768px) {
    body {
        padding-bottom: 70px;
    }
}

@media (max-width: 480px) {
    body {
        padding-bottom: 65px;
    }
}

