#audio-generation-message.success {
    color: #46b450;
    font-weight: bold;
}

#audio-generation-message.error {
    color: #dc3232;
    font-weight: bold;
}

#progress-bar {
    background: #f1f1f1;
    border-radius: 3px;
    overflow: hidden;
    margin: 10px 0;
}

#progress-fill {
    background: linear-gradient(90deg, #0073aa, #00a0d2);
    height: 20px;
    border-radius: 3px;
    transition: width 0.3s ease;
}

#progress-text {
    font-size: 12px;
    color: #666;
    text-align: center;
    margin-top: 5px;
}

#pending-audio {
    border: 1px solid #aaa;
    border-radius: 5px;
    padding: 10px;
}

#approved-audio {
    border: 1px solid #aaa;
    border-radius: 5px;
    padding: 10px;
}

/* Audio player ui for frontend */
.audio-player {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0 40px 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    position: relative;
}

.audio-player.sticky {
    position: fixed;
    top: 79px;
    margin: auto;
    padding: 15px;
    width: 100%;
    z-index: 10;
    transition: all 0.3s ease;
    left: 0;
    right: 0;
}

.audio-player .audio-controls {
    display: flex;
    gap: 15px;
    flex-direction: column;
}

.audio-player .audio-controls .audio-controls-top-wrapper {
    display: flex;
    gap: 15px;
    width: 100%;
    justify-content: space-between;
}

.audio-player .audio-controls .audio-controls-top-wrapper .audio-controls-left {
    max-width: calc(100% - 65px);
    width: 100%;
}

.audio-player .audio-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 0;
    letter-spacing: 0;
    line-height: 1;
    overflow: hidden;

}

.audio-player.sticky .audio-title {
    white-space: nowrap;
}

.audio-player .audio-subtitle {
    color: #dadada;
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
    margin-top: 4px;
}

.audio-player.sticky .audio-title .animate {
    display: inline-block;
    will-change: transform;
    animation: scroll-custom 10s ease-in-out 1s infinite;
}

.audio-player.sticky .audio-title .animate.no-overflow {
    animation: none;
}

@keyframes scroll-custom {
    0% {
        transform: translateX(0);
        /* Start - pause */
    }

    15.5% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(calc(var(--scroll-distance, 0px) * -1));
        /* End */
    }

    55.5% {
        transform: translateX(calc(var(--scroll-distance, 0px) * -1));
        /* Pause */
    }

    100% {
        transform: translateX(0);
        /* Back to start */
    }
}

.audio-player .play-btn {
    background: #00a99d;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    position: relative;
}

.audio-player .play-btn::after {
    content: '';
    display: block;
    width: 24px;
    height: 24px;
    background-size: 24px 24px;
    background-image: url('../images/play-fill.svg');
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.audio-player .play-btn.is-playing::after {
    background-image: url('../images/pause-fill.svg');
}

.audio-player .play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 169, 157, 0.4);
}

.audio-player .audio-progress-wrapper {
    display: flex;
    align-items: center;
    gap: 18px;
}

.audio-player .progress-bar {
    flex-grow: 1;
    height: 6px;
    background: #404040;
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.audio-player .buffer-fill {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, #00a99d 0%, #008a7d 100%);
    opacity: 0.25;
    width: 0%;
    transition: width 0.3s ease;
}

.audio-player .progress-fill {
    position: relative;
    height: 100%;
    background: linear-gradient(90deg, #00a99d 0%, #008a7d 100%);
    width: 0%;
    transition: width 0.1s ease;
    z-index: 1;
}

.audio-player .audio-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.audio-player .audio-time {
    color: #d0d0d0;
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.audio-player .audio-speed {
    position: relative;
}

.audio-player .audio-speed .speed-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    color: #ffffff;
    font-size: 13px;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.audio-player .audio-speed .speed-toggle:hover,
.audio-player .audio-speed .speed-toggle:focus {
    background: rgba(0, 169, 157, 0.25);
    border-color: rgba(0, 169, 157, 0.45);
    outline: none;
}

.audio-player .audio-speed .speed-menu {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(26, 26, 26, 0.98);
    border-radius: 10px;
    min-width: 120px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    display: none;
    z-index: 600;
}

.audio-player .audio-speed .speed-menu.open {
    display: block;
}

.audio-player .audio-speed .speed-menu li {
    margin: 0;
}

.audio-player .audio-speed .speed-menu li::before {
    display: none;
}

.audio-player .audio-speed .speed-menu button {
    width: 100%;
    background: transparent;
    border: none;
    color: #f0f0f0;
    font-size: 13px;
    padding: 8px 16px;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.audio-player .audio-speed .speed-menu button:hover,
.audio-player .audio-speed .speed-menu button:focus {
    background: rgba(0, 169, 157, 0.25);
    color: #ffffff;
    outline: none;
}

.audio-player .audio-speed .speed-menu button.is-active {
    background: rgba(0, 169, 157, 0.4);
    color: #ffffff;
}

.audio-player .audio-element {
    display: none;
}

.audio-player .audio-player-placeholder {
    display: none;
}

.audio-player .audio-player-placeholder.active {
    display: block;
    height: 120px;
    margin: 40px 0;
}

@media (min-width: 769px) {
    .audio-player.sticky {
        top: 70px;
        right: 20px;
        left: auto;
        transform: scale(0.8);
        width: 300px;
        border-radius: 15px;
    }
}

@media (max-width: 768px) {
    .audio-player.sticky .audio-controls {
        gap: 8px;
    }

    .audio-player.sticky .play-btn {
        width: 35px;
        height: 35px;
        background-size: 18px 18px;
    }

    .audio-player.sticky .audio-progress-wrapper {
        gap: 10px;
    }

    .audio-player.sticky .audio-meta {
        gap: 6px;
    }

    .audio-player.sticky .audio-time {
        font-size: 11px;
    }

    .audio-player.sticky .audio-speed .speed-toggle {
        padding: 2.5px 12px;
        font-size: 11px;
        min-width: 35px;
    }

    .audio-player.sticky .audio-speed .speed-menu {
        top: calc(100% + 6px);
    }

    .audio-player.sticky .audio-title {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .audio-player.sticky .audio-subtitle {
        font-size: 12px;
    }

    .audio-player.sticky {
        width: calc(100% - 24px);
    }
}

@media (min-width: 576px) {
    .audio-player.sticky {
        max-width: 516px;
    }
}