/* ============================================
   MINI RADIO PLAYER - ACCUEIL
   Se synchronise avec radio.html
   ============================================ */

/* === MINI PLAYER CONTAINER === */
.mini-radio-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card, linear-gradient(135deg, rgba(30, 30, 50, 0.98) 0%, rgba(20, 20, 35, 0.98) 100%));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color, rgba(99, 102, 241, 0.3));
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 9000;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease, border-color 0.3s ease;
    box-shadow: var(--shadow-lg, 0 -4px 20px rgba(0, 0, 0, 0.3));
}

.mini-radio-player.visible {
    transform: translateY(0);
}

.mini-radio-player.expanded {
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

/* === LAYOUT PRINCIPAL === */
.mini-radio-content {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

/* === LOGO RADIO === */
.mini-radio-logo {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

/* === INFOS RADIO === */
.mini-radio-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.mini-radio-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.mini-radio-status {
    font-size: 0.75rem;
    color: var(--text-secondary, rgba(255, 255, 255, 0.6));
    display: flex;
    align-items: center;
    gap: 4px;
}

.mini-radio-status.playing {
    color: #10b981;
}

.mini-radio-status .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.mini-radio-status.playing .status-dot {
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* === CONTROLES === */
.mini-radio-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.mini-radio-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary, #fff);
    background: var(--bg-elevated, rgba(255, 255, 255, 0.1));
}

.mini-radio-btn:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.2));
    transform: scale(1.05);
}

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

.mini-radio-btn .material-icons {
    font-size: 22px;
}

/* Bouton play principal */
.mini-radio-btn.play-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.mini-radio-btn.play-btn:hover {
    background: linear-gradient(135deg, #7c7ff2 0%, #9d78f7 100%);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.5);
}

.mini-radio-btn.play-btn .material-icons {
    font-size: 26px;
}

/* Bouton stop */
.mini-radio-btn.stop-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.mini-radio-btn.stop-btn:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Bouton expand (ouvrir player complet) */
.mini-radio-btn.expand-btn {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

.mini-radio-btn.expand-btn:hover {
    background: rgba(99, 102, 241, 0.3);
}

/* === SECTION VOLUME (affichée quand expanded) === */
.mini-radio-volume {
    display: none;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.mini-radio-player.expanded .mini-radio-volume {
    display: flex;
}

.mini-radio-volume .material-icons {
    font-size: 20px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.6));
}

.mini-radio-volume-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-elevated, rgba(255, 255, 255, 0.2));
    border-radius: 3px;
    cursor: pointer;
}

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

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

.mini-radio-volume-value {
    font-size: 0.8rem;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    min-width: 35px;
    text-align: right;
}

/* === ÉTAT INACTIF (pas de radio sélectionnée) === */
.mini-radio-player.inactive .mini-radio-logo {
    opacity: 0.5;
}

.mini-radio-player.inactive .mini-radio-name {
    color: rgba(255, 255, 255, 0.5);
}

/* === VISUALISEUR MINI === */
.mini-radio-visualizer {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 20px;
    margin-left: 8px;
}

.mini-radio-visualizer .bar {
    width: 3px;
    height: 30%;
    background: #6366f1;
    border-radius: 2px;
    transition: height 0.1s ease;
}

.mini-radio-visualizer.active .bar {
    animation: mini-visualize 0.8s ease-in-out infinite;
}

.mini-radio-visualizer .bar:nth-child(1) { animation-delay: 0s; }
.mini-radio-visualizer .bar:nth-child(2) { animation-delay: 0.1s; }
.mini-radio-visualizer .bar:nth-child(3) { animation-delay: 0.2s; }
.mini-radio-visualizer .bar:nth-child(4) { animation-delay: 0.15s; }

@keyframes mini-visualize {
    0%, 100% { height: 30%; }
    50% { height: 100%; }
}

/* === RESPONSIVE === */
@media (max-width: 360px) {
    .mini-radio-logo {
        width: 42px;
        height: 42px;
    }
    
    .mini-radio-name {
        font-size: 0.9rem;
    }
    
    .mini-radio-btn {
        width: 36px;
        height: 36px;
    }
    
    .mini-radio-btn.play-btn {
        width: 40px;
        height: 40px;
    }
    
    .mini-radio-btn .material-icons {
        font-size: 20px;
    }
}

/* === AJUSTEMENT DU CONTENU PRINCIPAL === */
body.mini-player-visible {
    padding-bottom: 80px;
}

body.mini-player-visible.mini-player-expanded {
    padding-bottom: 130px;
}

/* Bouton fermer */
.mini-radio-btn.close-btn {
    background: var(--bg-elevated, rgba(255, 255, 255, 0.05));
    color: var(--text-secondary, rgba(255, 255, 255, 0.5));
}

.mini-radio-btn.close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* ============================================
   THÈME CLAIR
   ============================================ */
[data-theme="light"] .mini-radio-player {
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .mini-radio-name {
    color: #1e293b;
}

[data-theme="light"] .mini-radio-status {
    color: #475569;
}

[data-theme="light"] .mini-radio-status.playing {
    color: #10b981;
}

[data-theme="light"] .mini-radio-btn {
    color: #1e293b;
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .mini-radio-btn:hover {
    background: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .mini-radio-btn.play-btn {
    color: #fff;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
}

[data-theme="light"] .mini-radio-btn.play-btn:hover {
    background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
}

[data-theme="light"] .mini-radio-btn.stop-btn {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

[data-theme="light"] .mini-radio-btn.stop-btn:hover {
    background: rgba(239, 68, 68, 0.25);
}

[data-theme="light"] .mini-radio-btn.expand-btn {
    background: rgba(79, 70, 229, 0.15);
    color: #4f46e5;
}

[data-theme="light"] .mini-radio-btn.expand-btn:hover {
    background: rgba(79, 70, 229, 0.25);
}

[data-theme="light"] .mini-radio-btn.close-btn {
    background: rgba(0, 0, 0, 0.05);
    color: #64748b;
}

[data-theme="light"] .mini-radio-btn.close-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

[data-theme="light"] .mini-radio-volume {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .mini-radio-volume .material-icons {
    color: #475569;
}

[data-theme="light"] .mini-radio-volume-slider {
    background: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .mini-radio-volume-value {
    color: #475569;
}

[data-theme="light"] .mini-radio-visualizer .bar {
    background: #4f46e5;
}

[data-theme="light"] .mini-radio-player.inactive .mini-radio-name {
    color: #94a3b8;
}
