/* ========================================
   Radio Fahazavana Player Styles
   ======================================== */

.fjkm-radio-player {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    /* Z-index très élevé pour ne pas se mélanger avec le footer */
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.fjkm-radio-player.visible {
    opacity: 1;
    transform: translateY(0);
}

.radio-player-container {
    background: linear-gradient(135deg, #1d67b0 0%, #155a94 100%);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    min-width: 320px;
    max-width: 380px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

/* Mode mini */
.radio-player-container.mini-mode {
    min-width: 180px;
    /* Reduced width since text is gone */
    max-width: 180px;
    padding: 10px;
}

.radio-player-container.mini-mode .radio-player-header {
    margin-bottom: 5px;
    display: flex;
    justify-content: center;
    /* Center the logo */
}

.radio-player-container.mini-mode .radio-logo {
    gap: 0;
    /* Remove gap since text is hidden */
}

.radio-player-container.mini-mode .radio-logo img {
    width: 40px;
    height: 40px;
    margin-left: -79px;
}

/* Hide text in mini mode */
.radio-player-container.mini-mode .radio-name,
.radio-player-container.mini-mode .status-text {
    display: none;
}

/* Keep status indicator visible and position it */
.radio-player-container.mini-mode .radio-status {
    margin: 0;
    position: absolute;
    top: 25px;
    left: 59px;
}

.radio-player-container.mini-mode .status-indicator {
    width: 10px;
    height: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    /* Add border for visibility */
}

.radio-player-container.mini-mode .radio-player-controls {
    padding: 8px;
    gap: 5px;
    justify-content: center;
}

.radio-player-container.mini-mode .radio-play-btn {
    width: 36px;
    height: 36px;
}

.radio-player-container.mini-mode .radio-play-btn svg {
    width: 18px;
    height: 18px;
}

/* Cacher l'equalizer et simplifier le volume en mode mini pour gagner de la place */
.radio-player-container.mini-mode .radio-equalizer {
    display: none;
}

.radio-player-container.mini-mode .volume-slider {
    width: 40px;
    /* Even smaller width */
    flex: none;
}

.radio-player-container.mini-mode .radio-player-header {
    margin-bottom: 10px;
}

.radio-player-container.mini-mode .radio-logo img {
    width: 40px;
    height: 40px;
}

.radio-player-container.mini-mode .radio-name {
    font-size: 16px;
}

.radio-player-container.mini-mode .radio-status {
    font-size: 11px;
}

.radio-player-container.mini-mode .radio-player-controls {
    padding: 12px;
    gap: 10px;
}

.radio-player-container.mini-mode .radio-play-btn {
    width: 40px;
    height: 40px;
}

.radio-player-container.mini-mode .radio-play-btn svg {
    width: 20px;
    height: 20px;
}

/* Header */
.radio-player-header {
    margin-bottom: 20px;
}

.radio-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.radio-logo img {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px;
}

.radio-info {
    flex: 1;
}

.radio-name {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.radio-status {
    margin: 5px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 10px #4ade80;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

.status-indicator.playing {
    background: #22c55e;
    box-shadow: 0 0 15px #22c55e;
}

.status-indicator.error {
    background: #ef4444;
    box-shadow: 0 0 10px #ef4444;
    animation: none;
}

/* Controls */
.radio-player-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.46);
    padding: 15px;
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

.radio-play-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.radio-play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

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

.radio-play-btn svg {
    width: 24px;
    height: 24px;
    color: #1d67b0;
}

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

/* Bouton pause blanc quand en lecture */
.radio-play-btn.playing {
    background: linear-gradient(135deg, #1d67b0 0%, #155a94 100%);
}

.radio-play-btn.playing svg {
    color: #ffffff;
}

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

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

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

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

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

.volume-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    position: relative;
    width: 34px;
    height: 34px;
}

.volume-btn:hover {
    transform: scale(1.1);
}

.volume-btn svg {
    width: 24px;
    height: 24px;
    color: #fff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s ease;
}

.volume-btn .icon-mute {
    opacity: 0;
}

.volume-btn.muted .icon-volume {
    opacity: 0;
}

.volume-btn.muted .icon-mute {
    opacity: 1;
}

.volume-slider {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 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: #fff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

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

/* Equalizer Animation */
.radio-equalizer {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 30px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.radio-equalizer.active {
    opacity: 1;
}

.eq-bar {
    width: 3px;
    background: #fff;
    border-radius: 2px;
    animation: equalizer 0.8s ease-in-out infinite;
}

.eq-bar:nth-child(1) {
    animation-delay: 0s;
}

.eq-bar:nth-child(2) {
    animation-delay: 0.2s;
}

.eq-bar:nth-child(3) {
    animation-delay: 0.4s;
}

.eq-bar:nth-child(4) {
    animation-delay: 0.6s;
}

@keyframes equalizer {

    0%,
    100% {
        height: 8px;
    }

    50% {
        height: 24px;
    }
}

/* Loading State */
.radio-play-btn.loading {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Close Button */
.radio-close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 1);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #fff;
    font-size: 16px;
    opacity: 0.6;
    z-index: 10;
}

.radio-close-btn:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.5);
    transform: rotate(90deg);
}

/* Toggle Mini Mode Button */
.radio-toggle-mini {
    position: absolute;
    top: 8px;
    right: 38px;
    /* Juste à côté du bouton fermer (8px + 24px + 6px gap) */
    left: auto;
    background: rgba(0, 0, 0, 1);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #fff;
    font-size: 12px;
    opacity: 0.6;
    z-index: 10;
}

.radio-toggle-mini:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.5);
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 768px) {
    .fjkm-radio-player {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }

    .radio-player-container {
        min-width: auto;
        max-width: none;
        padding: 15px;
    }

    .radio-name {
        font-size: 16px;
    }

    .radio-player-controls {
        gap: 10px;
        padding: 12px;
    }

    .radio-play-btn {
        width: 45px;
        height: 45px;
    }

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

/* Trigger Button (Banner Click) */
.radio-trigger-active {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.radio-trigger-active:hover {
    transform: scale(1.02);
}

/* Error State */
.radio-player-container.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.radio-player-container.error .radio-play-btn {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Success notification */
.radio-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(34, 197, 94, 0.95);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.radio-notification.hide {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}