/*
|--------------------------------------------------------------------------
| Audio Style Wrapper
|--------------------------------------------------------------------------
*/

.custom-tts-wrapper {
    width: 100%;
    margin: 22px 0 28px;
    color: #000000;
}

.custom-tts-title {
    margin: 0;
    padding: 0 8px 10px;
    color: #000000;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 700;
}

.custom-tts-audio-box {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 54px;
    padding: 8px 10px;
    background: #f1f3f4;
    border: 1px solid #dfe3e6;
    border-radius: 8px;
}

/*
|--------------------------------------------------------------------------
| Main Listen Button
|--------------------------------------------------------------------------
*/

.custom-tts-wrapper button {
    border: 0;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.tts-main-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    gap: 8px;
    min-width: 104px;
    height: 38px;
    padding: 0 14px;
    color: #ffffff;
    background: #111111;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
}

.tts-main-button:hover,
.tts-main-button:focus {
    background: #c92127;
    color: #ffffff;
}

.tts-play-icon {
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 11px solid currentColor;
}

.tts-main-button.is-pause .tts-play-icon {
    width: 12px;
    height: 14px;
    border: 0;
    background: linear-gradient(
        to right,
        currentColor 0 4px,
        transparent 4px 8px,
        currentColor 8px 12px
    );
}

/*
|--------------------------------------------------------------------------
| Audio Control Panel
|--------------------------------------------------------------------------
*/

.tts-control-panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.tts-progress-track {
    position: relative;
    width: 100%;
    height: 6px;
    overflow: hidden;
    background: #c9ced3;
    border-radius: 999px;
    cursor: pointer;
}

.tts-progress-track:focus {
    outline: 2px solid #111111;
    outline-offset: 3px;
}

.tts-progress-fill {
    display: block;
    width: 0;
    height: 100%;
    background: #c92127;
    border-radius: inherit;
    transition: width 0.25s ease;
}

.tts-controls-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.tts-controls-row button {
    flex: 0 0 auto;
    min-width: 58px;
    height: 28px;
    padding: 0 10px;
    color: #242424;
    background: #ffffff;
    border: 1px solid #d2d6da;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 700;
}

.tts-controls-row button:hover,
.tts-controls-row button:focus {
    color: #ffffff;
    background: #111111;
    border-color: #111111;
}

.tts-speed-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.tts-speed-select {
    flex: 0 0 auto;
    height: 28px;
    padding: 0 28px 0 10px;
    color: #242424;
    background: #ffffff;
    border: 1px solid #d2d6da;
    border-radius: 16px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
}

.tts-speed-select:hover,
.tts-speed-select:focus {
    border-color: #111111;
    outline: none;
}

.tts-volume-control {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 6px;
    height: 28px;
    padding: 0 7px;
    color: #242424;
    background: #ffffff;
    border: 1px solid #d2d6da;
    border-radius: 16px;
	margin-bottom:0;
}

.tts-volume-icon {
    position: relative;
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    color: #242424;
}

.tts-volume-icon::before {
    position: absolute;
    top: 5px;
    left: 0;
    width: 5px;
    height: 4px;
    background: currentColor;
    content: "";
}

.tts-volume-icon::after {
    position: absolute;
    top: 3px;
    left: 4px;
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-right: 7px solid currentColor;
    content: "";
}

.tts-volume-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.tts-volume-range {
    width: 38px;
    height: 6px;
    appearance: none;
    background: rgb(201, 206, 211);
    border-radius: 999px;
    cursor: pointer;
}

.tts-volume-range::-webkit-slider-runnable-track {
    height: 6px;
    background: transparent;
    border-radius: 999px;
}

.tts-volume-range::-webkit-slider-thumb {
    width: 0;
    height: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 0;
    box-shadow: none;
    opacity: 0;
}

.tts-volume-range::-moz-range-track {
    height: 6px;
    background: rgb(201, 206, 211);
    border: 0;
    border-radius: 999px;
}

.tts-volume-range::-moz-range-progress {
    height: 6px;
    background: rgb(201, 33, 39);
    border-radius: 999px;
}

.tts-volume-range::-moz-range-thumb {
    width: 0;
    height: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    opacity: 0;
}

.tts-volume-range::-ms-thumb {
    width: 0;
    height: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    opacity: 0;
}

.tts-volume-range::-ms-track {
    height: 6px;
    color: transparent;
    background: transparent;
    border-color: transparent;
}

.tts-volume-range::-ms-fill-lower {
    background: rgb(201, 33, 39);
    border-radius: 999px;
}

.tts-volume-range::-ms-fill-upper {
    background: rgb(201, 206, 211);
    border-radius: 999px;
}

.tts-volume-range:focus {
    outline: 2px solid #111111;
    outline-offset: 3px;
}

.tts-timer {
    flex: 0 0 auto;
    min-width: 92px;
    color: #242424;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    line-height: 28px;
    text-align: center;
    white-space: nowrap;
}

.tts-status {
    min-width: 72px;
    overflow: hidden;
    color: #3c4043;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/*
|--------------------------------------------------------------------------
| Responsive
|--------------------------------------------------------------------------
*/

@media (max-width: 600px) {

    .custom-tts-audio-box {
        align-items: center;
        flex-direction: row;
        gap: 6px;
        min-height: 48px;
        padding: 7px;
    }

    .tts-main-button {
        flex: 0 0 auto;
        min-width: 78px;
        height: 34px;
        gap: 6px;
        padding: 0 10px;
        font-size: 12px;
    }

    .tts-play-icon {
        border-top-width: 6px;
        border-bottom-width: 6px;
        border-left-width: 9px;
    }

    .tts-main-button.is-pause .tts-play-icon {
        width: 10px;
        height: 12px;
        background: linear-gradient(
            to right,
            currentColor 0 3px,
            transparent 3px 7px,
            currentColor 7px 10px
        );
    }

    .tts-control-panel {
        gap: 6px;
        min-width: 0;
    }

    .tts-controls-row {
        flex-wrap: nowrap;
        gap: 6px;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 1px;
        scrollbar-width: none;
        white-space: nowrap;
    }

    .tts-controls-row::-webkit-scrollbar {
        display: none;
    }

    .tts-speed-select {
        flex: 0 0 auto;
        width: 66px;
        height: 24px;
        padding: 0 18px 0 8px;
        font-size: 11px;
    }

    .tts-volume-control {
        flex: 0 0 auto;
        justify-content: center;
        width: 70px;
        height: 24px;
        padding: 0 6px;
    }

    .tts-volume-range {
        width: 34px;
    }

    .tts-timer {
        flex: 0 0 auto;
        min-width: 78px;
        font-size: 11px;
        line-height: 24px;
    }

    .tts-status {
        flex: 0 0 auto;
        min-width: 50px;
        max-width: 72px;
        font-size: 11px;
        text-align: left;
    }

}

@media (max-width: 360px) {

    .custom-tts-audio-box {
        gap: 5px;
        padding: 6px;
    }

    .tts-main-button {
        min-width: 66px;
        height: 32px;
        padding: 0 8px;
    }

    .tts-speed-select {
        width: 60px;
    }

    .tts-volume-control {
        width: 62px;
    }

    .tts-volume-range {
        width: 28px;
    }

    .tts-timer {
        min-width: 72px;
    }

}
