/* Player Bar Styling - Light Mode */
#app-player {
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.95) !important;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

/* Player Bar Styling - Dark Mode */
.dark #app-player {
    box-shadow: 0 -4px 40px rgba(0, 0, 0, 0.5);
    background: rgba(15, 23, 42, 0.95) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Volume control styling for themes */
#app-player input[type="range"] {
    accent-color: #2563eb;
    /* Blue-600 */
}

/* Progress Animation for Live Indicator */
@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

.playing-indicator {
    position: relative;
}

.playing-indicator::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid #2563eb;
    /* Blue-600 */
    animation: pulse-ring 1.5s infinite;
}

/* Hide default audio controls */
#player_radio {
    display: none;
}

/* Loading State Animation */
@keyframes loading-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.7;
    }
}

@keyframes loading-spinner {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes loading-waves {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
        /* Blue shadow */
    }

    70% {
        box-shadow: 0 0 0 15px rgba(37, 99, 235, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

#app-player.loading #player-play-btn {
    animation: loading-pulse 1.5s ease-in-out infinite, loading-waves 1.5s infinite;
}

#app-player.loading #player-play-btn::after {
    content: '';
    position: absolute;
    inset: -3px;
    border: 3px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: loading-spinner 1s linear infinite;
}

/* Error State Animation */
@keyframes error-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-4px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(4px);
    }
}

#app-player.error #player-play-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    animation: error-shake 0.5s ease-in-out;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

/* Error Toast Message - Light Mode */
#player-error-toast {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #991b1b;
    padding: 16px 24px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 100;
    opacity: 0;
    transition: all 0.6s ease-out;
    max-width: 400px;
    text-align: center;
    border: 1px solid #fca5a5;
}

/* Error Toast - Dark Mode */
.dark #player-error-toast {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #fecaca;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

#player-error-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

#player-error-toast .error-emoji {
    font-size: 2rem;
    margin-bottom: 8px;
    display: block;
}

#player-error-toast .error-message {
    font-size: 0.95rem;
    line-height: 1.5;
}

#player-error-toast .error-hint {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 8px;
}

/* Playing state indicator enhancement */
#app-player.playing #live-indicator {
    background: #22c55e;
}

#app-player.playing .playing-indicator::before {
    border-color: #22c55e;
}

/* Body padding when player is active to prevent footer overlap */
body.has-player {
    padding-bottom: 64px;
    transition: padding-bottom 0.5s ease-out;
}

@media (min-width: 768px) {
    body.has-player {
        padding-bottom: 96px;
    }
}

/* Override for Map Page - No padding as player floats over */
body.page-template-page-map.has-player {
    padding-bottom: 0 !important;
}

/* Animated Gradient for Clock */
@keyframes gradient-animation {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

#player-clock-bg {
    background-size: 200% 200%;
    animation: gradient-animation 15s ease infinite;
}