/* Kid-friendly Music Player Styles - Updated Gender Neutral Theme */
:root {
    --primary-color: #4A90E2;
    /* Friendly Blue */
    --secondary-color: #50C878;
    /* Emerald Green */
    --accent-color: #FF9F43;
    /* Warm Orange */
    --dark-color: #34495E;
    /* Charcoal Blue */
    --light-color: #F5F7FA;
    /* Light Gray */
    --success-color: #2ECC71;
    /* Bright Green */
    --progress-color: #FF6B8B;
    /* Coral Pink (kept for progress) */
}

/* Bottom Player with Slide Animation */
#bottomPlayer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.95) 0%, rgba(52, 73, 94, 0.95) 100%);
    backdrop-filter: blur(15px);
    border-top: 5px solid var(--accent-color);
    border-radius: 30px 30px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    visibility: hidden;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
}

#bottomPlayer.active {
    transform: translateY(0);
    visibility: visible;
}

/* Fun decorative top border */
#bottomPlayer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: repeating-linear-gradient(
    90deg,
    var(--accent-color),
    var(--accent-color) 15px,
    var(--secondary-color) 15px,
    var(--secondary-color) 30px
    );
    border-radius: 30px 30px 0 0;
}

/* Container padding */
#bottomPlayer .container {
    padding: 20px 15px;
}

/* Song info with improved scrolling */
.song-info {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 15px;
    margin-bottom: 20px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    min-height: 80px;
}

.song-title-container {
    overflow: hidden;
    white-space: nowrap;
    padding: 5px 0;
    margin-bottom: 10px;
    position: relative;
}

/* Gradient overlay for better scrolling visibility */
.song-title-container::before,
.song-title-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    z-index: 2;
    pointer-events: none;
}

.song-title-container::before {
    left: 0;
    background: linear-gradient(to right,
    rgba(52, 73, 94, 0.9) 0%,
    rgba(52, 73, 94, 0) 100%);
}

.song-title-container::after {
    right: 0;
    background: linear-gradient(to left,
    rgba(52, 73, 94, 0.9) 0%,
    rgba(52, 73, 94, 0) 100%);
}

#nowPlayingTitle {
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    white-space: nowrap;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    padding: 0 10px;
    display: inline-block;
    position: relative;
    z-index: 1;
    transition: transform 0.05s linear;
}

#nowPlayingSubtitle {
    color: var(--accent-color);
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Player Controls */
.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    margin: 25px 0;
}

.control-btn {
    background: var(--secondary-color);
    border: none;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.2);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.control-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 0 rgba(0, 0, 0, 0.2);
}

.control-btn:active {
    transform: translateY(2px) scale(0.98);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
}

.control-btn i {
    color: white;
    font-size: 1.8rem;
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.3));
}

/* Special styling for play/pause button */
#playPauseBtn {
    width: 90px !important;
    height: 90px !important;
    background: var(--primary-color);
    position: relative;
}

#playPauseBtn::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 3px dashed var(--accent-color);
    border-radius: 50%;
    animation: rotateBorder 20s linear infinite;
    pointer-events: none;
}

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

#playPauseBtn.playing {
    animation: gentlePulse 2s ease-in-out infinite;
}

@keyframes gentlePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 0 rgba(0, 0, 0, 0.2);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 12px 0 rgba(0, 0, 0, 0.2);
    }
}

/* Loading animation for play button */
#playPauseBtn.loading i {
    animation: spin 1s linear infinite;
}

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

/* Volume container */
.volume-container {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 25px;
    padding: 12px 25px;
    display: flex;
    align-items: center;
    margin: 20px 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.volume-container i {
    color: var(--accent-color);
    font-size: 1.5rem;
    margin-right: 15px;
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.2));
}

.volume-slider {
    flex: 1;
    height: 10px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, var(--secondary-color), var(--accent-color));
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 28px;
    height: 28px;
    background: white;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

/* Audio Wave Container */
.responsive-audio-wave-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    margin: 20px 0;
    height: 80px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    overflow: hidden;
}

/* Progress Bar */
.song-progress {
    background: rgba(255, 255, 255, 0.15);
    height: 14px;
    border-radius: 7px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    margin: 20px 0;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.progress-bar {
    background: linear-gradient(90deg, var(--progress-color), var(--accent-color));
    height: 100%;
    width: 0%;
    border-radius: 7px;
    position: relative;
    transition: width 0.1s linear;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transform: translate(50%, -50%);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8),
    inset 0 0 5px rgba(0, 0, 0, 0.2);
    border: 3px solid var(--primary-color);
}

/* Time and Song Info */
.playlist-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    flex-wrap: wrap;
    gap: 10px;
}

.time-display, .song-counter {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.95rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.1);
    min-width: 100px;
    text-align: center;
}

.song-counter {
    background: var(--success-color);
    order: 2;
    flex-grow: 0;
}

#currentTime {
    background: var(--primary-color);
}

#totalTime {
    background: var(--dark-color);
}

/* Close Button */
.close-player {
    background: rgba(255, 255, 255, 0.2);
    border: 3px solid white;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px auto 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.close-player:hover {
    background: var(--accent-color);
    transform: rotate(180deg) scale(1.1);
}

.close-player:active {
    transform: rotate(180deg) scale(0.95);
}

/* Loading indicator */
.loading-audio {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 1100;
}

.loading-audio.active {
    display: block;
}

.loading-audio::after {
    content: '';
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent-color);
    border-bottom-color: var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: block;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

/* Error message */
.audio-error {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--accent-color);
    color: white;
    padding: 15px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 1100;
    font-weight: bold;
    text-align: center;
    border: 3px solid white;
    font-size: 1.1rem;
    max-width: 90%;
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.audio-error.active {
    display: block;
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    #bottomPlayer {
        border-radius: 25px 25px 0 0;
        max-width: 100%;
    }

    #bottomPlayer .container {
        padding: 15px 10px;
    }

    .control-btn {
        width: 60px;
        height: 60px;
    }

    #playPauseBtn {
        width: 80px !important;
        height: 80px !important;
    }

    .control-btn i {
        font-size: 1.5rem;
    }

    #nowPlayingTitle {
        font-size: 1.5rem;
    }

    #nowPlayingSubtitle {
        font-size: 1rem;
    }

    .song-info {
        min-height: 70px;
        padding: 12px;
    }

    .volume-container {
        padding: 10px 15px;
    }

    .responsive-audio-wave-container {
        height: 60px;
    }

    .time-display, .song-counter {
        font-size: 0.85rem;
        padding: 6px 12px;
        min-width: 80px;
    }

    .close-player {
        width: 45px;
        height: 45px;
    }
}

.scrolling-text {
    animation: scrollingText 12s linear infinite;
}

@keyframes scrollingText {
    0% {
        transform: translateX(100%);
    }
    45% {
        transform: translateX(0);
    }
    65% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-150%);
    }
}

@media (max-width: 480px) {
    .player-controls {
        gap: 15px;
    }

    .control-btn {
        width: 55px;
        height: 55px;
    }

    #playPauseBtn {
        width: 70px !important;
        height: 70px !important;
    }

    #nowPlayingTitle {
        font-size: 1.3rem;
    }

    .playlist-info {
        flex-direction: column;
        gap: 10px;
    }

    .song-counter {
        order: 0;
    }
}

/* Animation for when player slides in */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Animation for when player slides out */
@keyframes slideOutDown {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(100%);
    }
}