/**
 * Custom Audio Player (CAP)
 * Popover-based audio player with custom controls
 */

.cap-popover {
    background: var(--surface-2, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--border-emphasis, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    min-width: 280px;
    max-width: 320px;
}

.cap-popover .arrow::after {
    border-top-color: var(--surface-2, rgba(255, 255, 255, 0.05));
}

.cap-popover .arrow::before {
    border-top-color: var(--border-emphasis, rgba(255, 255, 255, 0.1));
}

.cap-popover[x-placement^="bottom"] .arrow::after {
    border-bottom-color: var(--surface-2, rgba(255, 255, 255, 0.05));
    border-top-color: transparent;
}

.cap-popover[x-placement^="bottom"] .arrow::before {
    border-bottom-color: var(--border-emphasis, rgba(255, 255, 255, 0.1));
    border-top-color: transparent;
}

.cap-popover[x-placement^="left"] .arrow::after {
    border-left-color: rgba(30, 30, 30, 0.98);
    border-top-color: transparent;
}

.cap-popover[x-placement^="left"] .arrow::before {
    border-left-color: var(--border-emphasis, rgba(255, 255, 255, 0.1));
    border-top-color: transparent;
}

.cap-popover[x-placement^="right"] .arrow::after {
    border-right-color: var(--surface-2, rgba(255, 255, 255, 0.05));
    border-top-color: transparent;
}

.cap-popover[x-placement^="right"] .arrow::before {
    border-right-color: var(--border-emphasis, rgba(255, 255, 255, 0.1));
    border-top-color: transparent;
}

.cap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
}

.cap-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.cap-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.8);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 0;
    font-size: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.cap-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    text-decoration: none;
}

.cap-btn:active {
    transform: scale(0.92);
}

.cap-play-pause {
    width: 34px;
    height: 34px;
    background: #4a9eff;
    color: #fff;
    font-size: 12px;
}

.cap-play-pause:hover {
    background: #6bb2ff;
    color: #fff;
}

.cap-progress {
    flex: 1;
    min-width: 90px;
}

.cap-seek {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    cursor: pointer;
    margin: 0 0 6px 0;
    padding: 0;
}

.cap-seek::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.15);
}

.cap-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #4a9eff;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.cap-seek::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: #6bb2ff;
}

.cap-seek::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.15);
}

.cap-seek::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #4a9eff;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.cap-time {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-variant-numeric: tabular-nums;
}

.cap-download {
    color: rgba(255, 255, 255, 0.6);
}

.cap-download:hover {
    color: #34d399;
    background: rgba(52, 211, 153, 0.15);
}
