/**
 * Unified Audio Player Styles
 * Единые стили для всех аудиоплееров на сайте
 */

/* =============================================================================
   BASE VARIABLES AND CORE STYLES
   ============================================================================= */

.audioplayer {

    box-sizing: border-box;
    display: flex;
    align-items: center;
    color: #ffffff94;
    gap: var(--lg);
    border: 1px solid #fff;
    padding: 0;
    border-radius: var(--lg);
    background: transparent;
    border-radius: var(--hg);
    justify-content: center;
    border: 0;

}

/* =============================================================================
   BUTTON STYLES
   ============================================================================= */

/* Базовые стили только для кнопок БЕЗ класса btn--round (например для playlist, forward) */
.audioplayer button:not(.btn--round) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--audioplayer-btn-size) !important;
    height: var(--audioplayer-btn-size) !important;
    min-width: var(--audioplayer-btn-size) !important;
    max-width: var(--audioplayer-btn-size) !important;
    min-height: var(--audioplayer-btn-size) !important;
    max-height: var(--audioplayer-btn-size) !important;
    aspect-ratio: 1 / 1 !important;
    border: var(--audioplayer-btn-border);
    border-radius: 50%;
    background: var(--audioplayer-btn-bg);
    color: var(--audioplayer-primary-color);
    cursor: pointer;
    transition: var(--audioplayer-transition);
    -webkit-appearance: none;
    appearance: none;
    font-size: 0;
    line-height: 1;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    flex-basis: auto !important;
    position: relative;
    overflow: visible;
    box-sizing: border-box !important;
    padding: 0;
}

.audioplayer button:not(.btn--round):hover:not(:disabled) {
    background: var(--audioplayer-btn-bg-hover);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.audioplayer button:not(.btn--round):active:not(:disabled) {
    transform: scale(0.96);
}

.audioplayer button:not(.btn--round):focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.audioplayer button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.audioplayer button:not(.btn--round) i {
    font-size: 12px;
    pointer-events: none;
    line-height: 1;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: center;
}

/* Play button specific styles - только для кнопок БЕЗ класса btn--round */
.play:not(.btn--round) {
    background: var(--audioplayer-primary-color);
    color: #000000;
    border: 0;
}

.play:not(.btn--round):hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
}


/* Icon animation and transitions */
.play i {
    position: relative;
    display: inline-block;
    font-size: 0; /* Hide original icon */
}

/* Универсальные стили для play кнопок (и button, и a) */
.play.btn--round {
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.play i::before {
    font-family: "remixicon" !important;
    font-size: 10px;
}

/* Play icon (default state - when NOT playing) */
.play i::before {
    content: "\f00a"; /* ri-play-fill */
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform: scale(1) rotate(0deg);
    opacity: 1;
}

/* Pause icon (when playing) */
.play.playing i::before {
    content: "\efd8"; /* ri-pause-line */
    transform: scale(1.1) rotate(180deg);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
}

/* Hover effects */
.play:hover:not(:disabled) i::before {
    transform: scale(1.15) rotate(5deg);
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.8));
}

.play.playing:hover i::before {
    transform: scale(1.2) rotate(185deg);
    filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.9));
}

/* Elegant pulsation when playing */
.play.playing {
    animation: elegantPulse 3s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
    overflow: visible;
    position: relative;
    z-index: 10;
}

@keyframes elegantPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
        transform: scale(1);
    }
    25% {
        box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
        transform: scale(1.01);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(255, 255, 255, 0.1);
        transform: scale(1.03);
    }
    75% {
        box-shadow: 0 0 0 18px rgba(255, 255, 255, 0);
        transform: scale(1.01);
    }
}

/* Active state background transition - только для кнопок БЕЗ класса btn--round */
.play:not(.btn--round) {
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.play.playing:not(.btn--round) {
    background: rgba(0, 13, 12, 0.85);
    color: #ffffff;
    border: 1px solid rgb(0 44 40 / 85%);
    padding: 8px;
}

.play.playing:not(.btn--round):hover {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* Стили для кнопки play с классом btn--round - используют общие стили без переопределений */

/* Text labels (when enabled) */
.play-text,
.pause-text {
    margin-left: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.pause-text,
.play.playing .play-text {
    display: none;
}

.play.playing .pause-text {
    display: inline;
}

/* =============================================================================
   VISUAL CONTAINER (Waveform + Progress)
   ============================================================================= */

.visual-container {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    height: 48px;
    display: flex;
    align-items: center;
    cursor: pointer;
    overflow: visible;
}

/* Waveform Visualization */
.waveform {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
}

.bar {
    flex: 0 0 1px;
    width: 1px;
    border-radius: 1px;
    background: var(--white);
    opacity: 0.2;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.35));
    position: relative;
    z-index: 1;
    transition: background-color 0.1s ease;
}

.bar.active {
    background: var(--white);
}

/* Progress Slider */
.progress {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    z-index: 2;
    opacity: 0;
}

.progress:focus-visible {
    outline: none;
}

/* Webkit Slider Styles */
.progress::-webkit-slider-runnable-track {
    height: 100%;
    background: transparent;
    border: none;
}

.progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: var(--audioplayer-thumb-size);
    height: var(--audioplayer-thumb-size);
    border-radius: 50%;
    background: var(--audioplayer-primary-color);
    border: 0;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Firefox Slider Styles */
.progress::-moz-range-track {
    height: 100%;
    background: transparent;
    border: none;
}

.progress::-moz-range-thumb {
    width: var(--audioplayer-thumb-size);
    height: var(--audioplayer-thumb-size);
    border-radius: 50%;
    background: var(--audioplayer-primary-color);
    border: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Show thumb on hover */
.visual-container:hover .progress::-webkit-slider-thumb,
.visual-container:hover .progress::-moz-range-thumb {
    opacity: 1;
}

/* =============================================================================
   TIME DISPLAY
   ============================================================================= */

.time {
display: flex
;
    /* align-items: center; */
    font-family: var(--sans-secondary);
    font-size: var(--md);
    font-weight: var(--rg);
    color: var(--audioplayer-secondary-color);
    /* white-space: nowrap; */
    /* flex-shrink: 0; */
    min-width: max-content;
    min-width: max-content;
    opacity: 0.5;
    text-transform: uppercase;
    font-family: var(--sans-secondary);
}

.current-time,
.duration {
    line-height: 1;
}

.time-separator {
    opacity: 0.7;
}

/* =============================================================================
   ADDITIONAL CONTROLS (for full mode)
   ============================================================================= */

/* Контейнер для дополнительных кнопок управления */
.audioplayer-controls,
.controls {
    display: flex;
    align-items: center;
    gap: var(--sm);
    flex-shrink: 0;
}

/* Кнопки playlist и forward используют общие стили btn--round */

/* =============================================================================
   MODE VARIATIONS
   ============================================================================= */

/* Full mode with all controls */
.audioplayer[data-mode="full"] {
    --audioplayer-btn-size: 36px;

}

.audioplayer[data-mode="full"] .play {
    --audioplayer-btn-size: 40px;
}

.audioplayer[data-mode="full"] .audioplayer button i {
    font-size: 20px;
}

/* Compact mode */
.audioplayer[data-mode="compact"] {
    --audioplayer-btn-size: 24px;
    --audioplayer-bar-width: 2px;

}

.audioplayer[data-mode="compact"] .audioplayer button i {
    font-size: 14px;
}

.audioplayer[data-mode="compact"] .time {
    font-size: 10px;
}

/* Card mode (for cards) */
.audioplayer[data-mode="card"] {
    --audioplayer-btn-bg: rgba(255, 255, 255, 0.14);
    --audioplayer-btn-bg-hover: rgba(255, 255, 255, 0.22);
    --audioplayer-btn-border: 1px solid rgba(255, 255, 255, 0.25);
}

.audioplayer[data-mode="card"] .play.playing {
    --audioplayer-btn-bg: rgba(46, 204, 113, 0.2);
    --audioplayer-btn-border: 1px solid rgba(46, 204, 113, 0.4);
    background: var(--audioplayer-btn-bg);
    border: var(--audioplayer-btn-border);
    color: rgba(46, 204, 113, 1);
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (min-width: 300px) and (max-width: 576px) {
}
@media (min-width: 577px) and (max-width: 768px) {


}

@media (min-width: 769px) and (max-width: 1025px) {

}


@media (min-width: 1600px) {

}



/* =============================================================================
   UTILITY CLASSES
   ============================================================================= */

.hidden {
    display: none !important;
}

.audioplayer audio {
    display: none;
}

/* Accessibility improvements */
.audioplayer:focus-within .progress::-webkit-slider-thumb,
.audioplayer:focus-within .progress::-moz-range-thumb {
    opacity: 1;
}

/* Loading state */
.audioplayer.loading .audioplayer button {
    pointer-events: none;
    opacity: 0.6;
}

.audioplayer.loading .waveform {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Error state */
.audioplayer.error {
    opacity: 0.5;
}

.audioplayer.error .audioplayer button {
    pointer-events: none;
    cursor: not-allowed;
}

/* =============================================================================
   FOOTER AUDIOPLAYER STYLES
   ============================================================================= */

/* Footer audioplayer specific modifications */
.audioplayer-footer .track-title {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;

    pointer-events: none;
    z-index: 1;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    font-size: var(--md);
    font-weight: 500;
    color: var(--audioplayer-primary-color);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
        text-transform: uppercase;
}

@media (min-width: 300px) and (max-width: 576px) {
    .audioplayer-footer .track-title {
    font-size: var(--lg);
}
}
@media (min-width: 577px) and (max-width: 768px) {
    .audioplayer-footer .track-title {
    font-size: var(--lg);
}

}

@media (min-width: 769px) and (max-width: 1024px) {

}


@media (min-width: 1025px) {

}

.audioplayer-footer .track-name {
    display: block;
    width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

/* Hide waveform for footer player */
.audioplayer-footer .waveform {
    display: none;
}

@media (min-width: 300px) and (max-width: 576px) {
footer .audioplayer,
.audioplayer-footer.audioplayer {
        width: 100%;
        background: rgba(0, 13, 12, 0.85);
        backdrop-filter: blur(5px);
        border-top: 1px solid #00ecff1a;
}
}
@media (min-width: 577px) and (max-width: 768px) {
footer .audioplayer,
.audioplayer-footer.audioplayer {
    width: 100%;
            width: 100%;
        background: rgba(0, 13, 12, 0.85);
        backdrop-filter: blur(5px);
        border-top: 1px solid #00ecff1a;
}

}

@media (min-width: 769px) and (max-width: 1025px) {
footer .audioplayer,
.audioplayer-footer.audioplayer {
    width: 100%;
            width: 100%;
        background: rgba(0, 13, 12, 0.85);
        backdrop-filter: blur(5px);
        border-top: 1px solid #00ecff1a;
}
}



@media (min-width: 1025px) and (max-width: 1600px) {
footer .audioplayer,
.audioplayer-footer.audioplayer {
    width: 20%;

}
}

@media (min-width: 1600px)  {
footer .audioplayer,
.audioplayer-footer.audioplayer,
.audioplayer {
    width: 20% ;

}
}

/* =============================================================================
   WIDTH MODIFIERS
   ============================================================================= */

/* Модификатор для полной ширины плеера */
.audioplayer--full-width {
    width: 100% !important;
}
