/* Stream Player Widget Styles */

.stream-player-widget {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 50%, #0d0d0d 100%);
    border-radius: 16px;
    padding: 24px;
    max-width: 400px;
    margin: 0 auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: #fad98c;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(250, 217, 140, 0.15);
}

.stream-player-widget::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(250, 217, 140, 0.02) 0%, transparent 70%);
    pointer-events: none;
}

/* Header with live indicator - floats in top left */
.stream-header {
    position: absolute;
    top: 12px;
    left: 16px;
    z-index: 10;
}

.stream-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #666;
    transition: all 0.3s ease;
}

.status-dot.live {
    background: #ff4444;
    box-shadow: 0 0 10px #ff4444, 0 0 20px #ff4444;
    animation: pulse-live 1.5s ease-in-out infinite;
}

.status-dot.radio {
    background: #4CAF50;
    box-shadow: 0 0 10px #4CAF50;
}

.status-dot.offline {
    background: #666;
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.status-text {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #aaa;
}

.status-text.live {
    color: #ff6b6b;
}

.status-text.radio {
    color: #81c784;
}

.listener-count {
    position: absolute;
    top: 12px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #888;
    z-index: 10;
}

.listener-count svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Now Playing Section */
.now-playing {
    text-align: center;
    margin-bottom: 16px;
    padding-top: 0;
    position: relative;
    z-index: 1;
}

.now-playing-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #8b7355;
    margin-bottom: 12px;
}

.track-title {
    font-size: 20px;
    font-weight: 700;
    color: #fad98c;
    margin: 0 0 6px 0;
    line-height: 1.3;
    min-height: 26px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-title.scrolling {
    animation: scroll-text 10s linear infinite;
    white-space: nowrap;
}

@keyframes scroll-text {
    0%, 20% { transform: translateX(0); }
    80%, 100% { transform: translateX(-50%); }
}

.track-artist {
    font-size: 15px;
    color: #c4a574;
    margin: 0;
    min-height: 20px;
    transition: opacity 0.15s ease;
}

.track-album {
    font-size: 13px;
    color: #8b7355;
    margin: 4px 0 0 0;
    min-height: 18px;
    font-style: italic;
    transition: opacity 0.15s ease;
}

.track-album:empty {
    display: none;
}

/* Audio Controls */
.audio-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.play-button {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #803052 0%, #5c2240 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(128, 48, 82, 0.4);
}

.play-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(128, 48, 82, 0.5);
}

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

.play-button svg {
    width: 28px;
    height: 28px;
    fill: #fff;
    margin-left: 3px; /* Visual centering for play icon */
}

.play-button.playing svg {
    margin-left: 0;
}

/* Buffering/Loading State */
.play-button.buffering {
    cursor: wait;
}

.play-button .loading-icon {
    animation: spin 1s linear infinite;
    stroke: #fff;
    margin-left: 0;
}

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

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.volume-icon {
    width: 20px;
    height: 20px;
    fill: #888;
    cursor: pointer;
    transition: fill 0.2s ease;
}

.volume-icon:hover {
    fill: #fff;
}

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

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #803052;
    cursor: pointer;
    transition: transform 0.2s ease;
}

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

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

/* Stream Info Footer */
.stream-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(250, 217, 140, 0.15);
    position: relative;
    z-index: 1;
}

.info-item {
    text-align: center;
}

.info-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6b5a45;
    margin-bottom: 4px;
}

.info-value {
    font-size: 13px;
    color: #c4a574;
    font-weight: 500;
}

/* Loading State */
.stream-player-widget.loading .now-playing {
    opacity: 0.5;
}

.stream-player-widget.loading .track-title::after {
    content: '...';
    animation: loading-dots 1s infinite;
}

@keyframes loading-dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

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

/* Responsive */
@media (max-width: 480px) {
    .stream-player-widget {
        margin: 0;
        padding: 20px;
        border-radius: 12px;
        max-width: none;
        width: 100%;
        box-sizing: border-box;
    }
    
    .track-title {
        font-size: 18px;
    }
    
    .play-button {
        width: 56px;
        height: 56px;
    }
    
    .volume-slider {
        width: 80px;
    }
}
