/**
 * Radiospeler Popup Player CSS
 * Met dynamische themakleur en geoptimaliseerde compacte layout
 */

:root {
    --theme-color: #3498db;
    --theme-dark: #2980b9;
    --theme-light: #ebf5ff;
    --theme-glow: rgba(52, 152, 219, 0.4);
    --theme-glow-hover: rgba(52, 152, 219, 0.5);
}

.radiospeler-popup * {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecf2 100%);
    margin: 0;
    padding: 10px; /* Gelijke padding rondom de hele pagina */
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    box-sizing: border-box;
}

.radiospeler-popup {
    max-width: 440px;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    padding: 20px; /* Gelijke padding binnen de witte achtergrond */
    display: flex;
    flex-direction: column;
    margin: auto; /* Zorgt voor perfecte centrering */
}

/* Logo */
.radiospeler-logo {
    text-align: center;
    margin-bottom: 12px; /* Minder marge */
    flex-shrink: 0;
}

.radiospeler-logo img {
    max-width: 180px; /* Iets kleiner */
    max-height: 70px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Cover Art */
.radiospeler-cover-container {
    width: 100%;
    max-width: 340px; /* Iets kleiner voor balans */
    aspect-ratio: 1/1;
    margin: 0 auto 10px; /* Minder marge */
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    background: #f0f0f0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.radiospeler-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
    display: block;
}

/* Metadata - compact */
.radiospeler-metadata {
    text-align: center;
    margin-bottom: 10px;
    min-height: 75px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.artist-title {
    font-size: 1.1rem; /* Iets kleiner */
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.2;
    padding: 0 5px;
    word-wrap: break-word;
    letter-spacing: -0.01em;
    margin-bottom: 2px;
}

.show-name {
    font-size: 0.85rem;
    color: #7f8c8d;
    font-style: italic;
    font-weight: 400;
    margin-bottom: 2px;
    display: none;
}

/* Live indicator compact */
.popup-live-indicator {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 2px 0 0;
}

.popup-live-indicator .live-dot {
    width: 6px;
    height: 6px;
    background: #e74c3c;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.popup-live-indicator .live-text {
    font-size: 0.7rem;
    color: #e74c3c;
    font-weight: 500;
    letter-spacing: 0.3px;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

/* Controls - compact */
.radiospeler-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
    flex-shrink: 0;
}

.play-pause-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: var(--theme-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px var(--theme-glow);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.play-pause-btn:hover {
    transform: scale(1.05);
    background: var(--theme-dark);
    box-shadow: 0 6px 15px var(--theme-glow-hover);
}

.play-pause-btn svg {
    width: 24px;
    height: 24px;
}

/* Loading spinner voor play button */
.play-pause-btn .loading-spinner {
    display: none;
    width: 24px;
    height: 24px;
    color: white;
    font-size: 24px;
    line-height: 1;
    animation: pulse 1s ease-in-out infinite;
}

.play-pause-btn.loading {
    animation: none;
}

@keyframes pulse {
    0% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 0.3; transform: scale(0.8); }
}

.volume-control {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 30px;
    border: 1px solid #e9ecef;
}

.volume-icon {
    width: 16px;
    height: 16px;
    color: #6c757d;
    flex-shrink: 0;
}

.volume-control input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    background: linear-gradient(to right, var(--theme-color), #2ecc71);
    border-radius: 10px;
    outline: none;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--theme-color);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transition: transform 0.1s ease;
}

.volume-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

/* Quality Selector - compact */
.radiospeler-quality {
    margin-bottom: 6px;
    background: transparent;
    border-radius: 0;
    padding: 0;
    border: none;
    flex-shrink: 0;
}

.quality-label {
    display: block;
    font-size: 0.7rem;
    color: #6c757d;
    margin-bottom: 4px;
    font-weight: 500;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
}

.quality-options {
    display: flex;
    flex-direction: row;
    gap: 3px;
    justify-content: center;
}

.quality-option {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 2px 3px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.quality-option:hover {
    border-color: var(--theme-color);
    background: #f0f9ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px var(--theme-glow);
}

.quality-option.active {
    border-color: var(--theme-color);
    background: var(--theme-light);
}

.quality-option input[type="radio"] {
    display: none;
}

.quality-name {
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.7rem;
    margin-bottom: 0;
}

.quality-badge {
    font-size: 0.55rem;
    color: #6c757d;
    background: transparent;
    padding: 0;
    border-radius: 0;
    display: inline-block;
    font-weight: 400;
    opacity: 0.8;
    margin-bottom: 1px;
}

.quality-bitrate {
    font-size: 0.5rem;
    color: #8a9aa8;
    font-weight: 400;
    opacity: 0.7;
    letter-spacing: 0.2px;
}

.quality-option.active .quality-bitrate {
    color: var(--theme-color);
    opacity: 0.9;
}

/* VU Meter - dunner */
.vu-meter {
    width: 100%;
    height: 20px;
    background: #f1f3f5;
    border-radius: 10px;
    margin-top: 4px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
    flex-shrink: 0;
}

/* Mobiel/kleine schermen - alleen voor schermen kleiner dan 460px */
@media (max-width: 459px) {
    body {
        padding: 10px;
    }
    
    .radiospeler-popup {
        padding: 16px;
    }
    
    .radiospeler-logo img {
        max-width: 160px;
        max-height: 60px;
    }
    
    .artist-title {
        font-size: 1rem;
    }
    
    .show-name {
        font-size: 0.8rem;
    }
    
    .play-pause-btn {
        width: 44px;
        height: 44px;
    }
    
    .play-pause-btn svg {
        width: 22px;
        height: 22px;
    }
    
    .quality-options {
        gap: 2px;
    }
    
    .quality-option {
        padding: 3px 1px 2px;
    }
    
    .quality-name {
        font-size: 0.65rem;
    }
    
    .quality-badge {
        font-size: 0.5rem;
    }
    
    .quality-bitrate {
        font-size: 0.45rem;
    }
    
    /* iPhone-specifieke fixes voor cover art */
    .radiospeler-cover-container {
        max-width: 300px;
    }
}

/* Stream-statusmelding (bufferen / opnieuw verbinden) */
.stream-status {
    font-size: 0.75rem;
    color: #e67e22;
    font-weight: 500;
    margin-top: 4px;
    animation: pulse 1.2s infinite;
}

/* Toegankelijkheid: schakel animaties uit indien gewenst */
@media (prefers-reduced-motion: reduce) {
    .live-dot,
    .loading-spinner,
    .stream-status {
        animation: none !important;
    }
}
