/* ========================================
   CUSTOM AUDIO PLAYER — DESIGN SETTINGS
   ======================================== */
:root {
    --audio-bg: #f1f3f5;
    --audio-border: #dce0e4;

    --audio-button-bg: #2878d0;
    --audio-button-color: #ffffff;
    --audio-button-hover: #1765b9;

    --audio-progress-bg: #d4d9df;
    --audio-progress-color: #2878d0;

    --audio-text: #555e68;

    --audio-height: 58px;
    --audio-radius: 10px;
    --audio-button-size: 38px;

    --audio-gap: 12px;
    --audio-padding: 10px 14px;

    --audio-transition: 0.2s ease;
}

/* Main container */

.custom-audio {
    display: flex;
    align-items: center;
    gap: var(--audio-gap);

    width: 100%;
    height: var(--audio-height);
    box-sizing: border-box;

    padding: var(--audio-padding);

    background: var(--audio-bg);
    border: 1px solid var(--audio-border);
    border-radius: var(--audio-radius);
}

/* Hide native audio */

.custom-audio audio {
    display: none;
}

/* Play / Pause button */

.audio-play {
    width: var(--audio-button-size);
    height: var(--audio-button-size);
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border: none;
    border-radius: 50%;
    background: var(--audio-button-bg);
    color: var(--audio-button-color);

    font-size: 16px;
    line-height: 1;

    cursor: pointer;
    transition: background var(--audio-transition);
}

.audio-play:hover {
    background: var(--audio-button-hover);
}

.audio-play .icon-pause {
    display: none;
}

.custom-audio.playing .icon-play {
    display: none;
}

.custom-audio.playing .icon-pause {
    display: inline;
}

/* Progress area */

.audio-content {
    flex: 1;
    min-width: 0;

    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Progress bar */

.audio-progress {
    width: 100%;
    height: 6px;
    margin: 0;

    background: var(--audio-progress-bg);
    border-radius: 10px;

    cursor: pointer;
    overflow: hidden;
}

.audio-progress-fill {
    width: 0;
    height: 100%;

    background: var(--audio-progress-color);
    border-radius: inherit;

    transition: width 0.05s linear;
}

/* Time indicators */

.audio-controls {
    display: flex;
    justify-content: space-between;

    margin-top: 5px;

    color: var(--audio-text);
    font-size: 11px;
    line-height: 1;

    font-family: Arial, sans-serif;
    font-variant-numeric: tabular-nums;
    
}

/* Volume button */

.audio-volume {
    width: 30px;
    height: 30px;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border: none;
    background: transparent;
    color: var(--audio-text);

    font-size: 20px;
    line-height: 1;

    cursor: pointer;
}

.audio-volume .volume-off {
    display: none;
}

.custom-audio.muted .volume-on {
    display: none;
}

.custom-audio.muted .volume-off {
    display: inline;
}

/* Mobile */

@media (max-width: 480px) {
    :root {
        --audio-height: 54px;
        --audio-padding: 8px 10px;
        --audio-gap: 9px;
        --audio-button-size: 34px;
    }
}







/* ========================================
   VERTICAL ALIGNMENT CORRECTIONS
   ======================================== */

/* Центрирование содержимого плеера */
.custom-audio {
    align-items: center;
}

/* Кнопка и её пиктограммы */
.audio-play {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.audio-play .icon-play {
    display: block;
    position: relative;
    left: 1px;
    top: -1px;
}

.audio-play .icon-pause {
    position: relative;
    top: -1px;
}

/* Центрирование именно полосы прогресса */
.audio-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    padding: 0;
}

.audio-progress {
    flex-shrink: 0;
    position: relative;
    top: 0;
    margin: 0;
}

/* Время не должно влиять на центрирование полосы */
.audio-controls {
    flex-shrink: 0;
    margin-top: 5px;
    line-height: 1;
}






/* ========================================
   PRECISE VERTICAL ALIGNMENT
   ======================================== */

/* Main player */
.custom-audio {
    position: relative;
    display: flex;
    align-items: center;
}

/* Play button */
.audio-play {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.audio-play .icon-play {
    position: relative;
    left: 1px;
    top: -1px;
}

.audio-play .icon-pause {
    position: relative;
    top: -1px;
}

/* Progress container */
.audio-content {
    position: relative;
    height: 100%;
    flex: 1;
    min-width: 0;

    display: block;
}

/* Progress bar — exact vertical center */
.audio-progress {
    position: absolute;
    top: 50%;
    left: 0;

    width: 100%;
    height: 6px;
    margin: 0;

    transform: translateY(-50%);
}

/* Time — bottom aligned */
.audio-controls {
    position: absolute;
    bottom: 6px;
    left: 0;
    right: 0;

    display: flex;
    justify-content: space-between;

    margin: 0;
    line-height: 1;
    bottom:  -4px;
}


/* Pause icon — two clear vertical bars */

.audio-play .icon-pause {
    display: none;
    position: relative;
    top: 0;

    width: 12px;
    height: 15px;

    font-size: 0;
    line-height: 0;
}

.audio-play .icon-pause::before,
.audio-play .icon-pause::after {
    content: "";
    position: absolute;
    top: 0;

    width: 4px;
    height: 15px;

    background: currentColor;
    border-radius: 1px;
}

.audio-play .icon-pause::before {
    left: 0;
}

.audio-play .icon-pause::after {
    right: 0;
}

