/**
 * WebRadio Player Styles
 * 
 * @package WebRadio_WP
 */

/* ==========================================================================
   Base Player Styles
   ========================================================================== */

.webradio-player {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    min-height: 200px;
}

.webradio-player:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.webradio-player.loading {
    opacity: 0.7;
}

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

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

.webradio-player .pause-icon {
    display: none;
}

/* ==========================================================================
   Player Controls
   ========================================================================== */

.player-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e4e8;
}

.play-pause-btn,
.stop-btn {
    background: #007cba;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-pause-btn:hover,
.stop-btn:hover {
    background: #005a87;
    transform: scale(1.05);
}

.play-pause-btn:active,
.stop-btn:active {
    transform: scale(0.98);
}

.stop-btn {
    background: #666;
    width: 36px;
    height: 36px;
    font-size: 14px;
}

.stop-btn:hover {
    background: #444;
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.volume-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.volume-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.volume-slider {
    width: 100px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    outline: none;
    appearance: none;
    cursor: pointer;
}

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

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

/* ==========================================================================
   Current Track Display
   ========================================================================== */

.current-track {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #fff;
}

.track-artwork {
    flex-shrink: 0;
}

.track-artwork img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.track-details {
    flex: 1;
    min-width: 0;
}

.track-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: #24292e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    font-size: 14px;
    color: #586069;
    margin: 0 0 8px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #6a737d;
}

.track-meta .status.live {
    color: #d73a49;
    font-weight: 600;
    text-transform: uppercase;
}

.track-meta .status.offline {
    color: #6a737d;
}

/* Live Indicator */
.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #d73a49;
    color: white;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

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

.webradio-player.live-mode .current-track {
    background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
}

/* Progress Bar */
.track-progress {
    margin-top: 10px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #e1e4e8;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background: #007cba;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-time {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #6a737d;
}

/* ==========================================================================
   Playlist
   ========================================================================== */

.playlist-container {
    background: #f8f9fa;
    border-top: 1px solid #e1e4e8;
}

.playlist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #f1f3f4;
    border-bottom: 1px solid #e1e4e8;
}

.playlist-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #24292e;
}

.playlist-toggle {
    background: none;
    border: none;
    font-size: 12px;
    cursor: pointer;
    padding: 5px;
    color: #586069;
}

.playlist-content {
    max-height: 300px;
    overflow-y: auto;
}

.playlist-loading {
    padding: 20px;
    text-align: center;
    color: #6a737d;
    font-size: 14px;
}

.playlist-tracks {
    list-style: none;
    margin: 0;
    padding: 0;
}

.playlist-track {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid #e1e4e8;
    cursor: pointer;
    transition: background 0.2s ease;
}

.playlist-track:hover {
    background: #f6f8fa;
}

.playlist-track:last-child {
    border-bottom: none;
}

.playlist-track .track-info {
    flex: 1;
    min-width: 0;
}

.playlist-track .track-title {
    font-size: 13px;
    font-weight: 500;
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-track .track-artist {
    font-size: 12px;
    color: #6a737d;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-track .track-duration {
    font-size: 12px;
    color: #6a737d;
    font-weight: 500;
}

/* ==========================================================================
   Player Footer
   ========================================================================== */

.player-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e1e4e8;
}

.player-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.share-btn,
.download-btn,
.fullscreen-btn {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    color: #586069;
    transition: all 0.2s ease;
}

.share-btn:hover,
.download-btn:hover,
.fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #24292e;
}

.close-player {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    color: #6a737d;
    border-radius: 4px;
}

.close-player:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #d73a49;
}

/* ==========================================================================
   Theme Variations
   ========================================================================== */

/* Dark Theme */
.webradio-player.theme-dark {
    background: #1a1a1a;
    border-color: #333;
    color: #e1e1e1;
}

.webradio-player.theme-dark .player-controls {
    background: #2a2a2a;
    border-bottom-color: #333;
}

.webradio-player.theme-dark .current-track {
    background: #1a1a1a;
}

.webradio-player.theme-dark .track-title {
    color: #ffffff;
}

.webradio-player.theme-dark .track-artist,
.webradio-player.theme-dark .track-meta {
    color: #a0a0a0;
}

.webradio-player.theme-dark .playlist-container {
    background: #2a2a2a;
    border-top-color: #333;
}

.webradio-player.theme-dark .playlist-header {
    background: #333;
    border-bottom-color: #444;
}

.webradio-player.theme-dark .playlist-track {
    border-bottom-color: #333;
}

.webradio-player.theme-dark .playlist-track:hover {
    background: #333;
}

.webradio-player.theme-dark .player-footer {
    background: #2a2a2a;
    border-top-color: #333;
}

/* Light Theme */
.webradio-player.theme-light {
    background: #fafafa;
    border-color: #ddd;
}

.webradio-player.theme-light .player-controls {
    background: #ffffff;
}

/* Minimal Theme */
.webradio-player.theme-minimal {
    border: none;
    box-shadow: none;
    background: transparent;
}

.webradio-player.theme-minimal .player-controls {
    background: transparent;
    border: none;
    padding: 10px 0;
}

.webradio-player.theme-minimal .current-track {
    background: transparent;
    padding: 10px 0;
}

.webradio-player.theme-minimal .playlist-container,
.webradio-player.theme-minimal .player-footer {
    display: none;
}

/* Modern Theme */
.webradio-player.theme-modern {
    border-radius: 16px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.webradio-player.theme-modern .player-controls {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: none;
}

.webradio-player.theme-modern .current-track {
    background: transparent;
}

.webradio-player.theme-modern .track-title {
    color: white;
}

.webradio-player.theme-modern .track-artist,
.webradio-player.theme-modern .track-meta {
    color: rgba(255, 255, 255, 0.8);
}

.webradio-player.theme-modern .play-pause-btn,
.webradio-player.theme-modern .stop-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.webradio-player.theme-modern .play-pause-btn:hover,
.webradio-player.theme-modern .stop-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   Floating Player Styles
   ========================================================================== */

.webradio-player.floating {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.webradio-player.floating .playlist-container {
    display: none;
}

.webradio-player.floating .current-track {
    padding: 15px;
}

.webradio-player.floating .track-artwork img {
    width: 60px;
    height: 60px;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .webradio-player {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .player-controls {
        padding: 12px 15px;
    }
    
    .current-track {
        padding: 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .track-artwork {
        align-self: center;
    }
    
    .volume-control {
        margin-left: 0;
    }
    
    .volume-slider {
        width: 80px;
    }
    
    .webradio-player.floating {
        width: 280px;
        bottom: 10px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .webradio-player.floating {
        width: calc(100vw - 20px);
        left: 10px;
        right: 10px;
    }
    
    .playlist-content {
        max-height: 200px;
    }
    
    .current-track {
        padding: 12px;
    }
    
    .track-artwork img {
        width: 60px;
        height: 60px;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .webradio-player,
    .play-pause-btn,
    .stop-btn,
    .progress-fill,
    .playlist-track {
        transition: none;
    }
    
    .live-dot {
        animation: none;
    }
}

/* Focus styles for keyboard navigation */
.play-pause-btn:focus,
.stop-btn:focus,
.volume-btn:focus,
.volume-slider:focus,
.playlist-toggle:focus,
.share-btn:focus,
.download-btn:focus,
.fullscreen-btn:focus,
.close-player:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .webradio-player {
        border-width: 2px;
    }
    
    .play-pause-btn,
    .stop-btn {
        border: 2px solid currentColor;
    }
}