/**
 * Fedora Custom Plyr Styles - Minimal Design to Match Screenshot
 *
 * @package FedoraPlugin
 */

/* Main wrapper layout */
.fedora-audio-player-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 24px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: white;
    border-radius: 30px;
    padding: 18px;
}

/* Volume icon styling */
.fedora-audio-player-wrapper .fedora-volume-icon {
    width: 16px;
    height: 16px;
    color: #999999;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    margin-right: 12px;
    cursor: pointer;
    position: relative;
    order: 0;
}

.fedora-audio-player-wrapper .fedora-volume-icon:hover {
    opacity: 0.7;
}

.fedora-audio-player-wrapper .fedora-volume-icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Plyr controls container */
.fedora-audio-player-wrapper .plyr--audio .plyr__controls {
    background: transparent;
    border: none;
    color: #999999;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 24px;
    flex: 1;
}

/* Hide volume and unnecessary controls */
.fedora-audio-player-wrapper .plyr__volume,
.fedora-audio-player-wrapper .plyr__menu,
.fedora-audio-player-wrapper .plyr__pip,
.fedora-audio-player-wrapper .plyr__airplay,
.fedora-audio-player-wrapper .plyr__fullscreen,
.fedora-audio-player-wrapper .plyr__captions {
    display: none !important;
}

/* Time displays */
.fedora-audio-player-wrapper .plyr__time {
    font-size: 13px !important;
    color: #999999 !important;
    font-variant-numeric: tabular-nums;
    font-weight: 400;
    line-height: 1;
    margin: 0;
    padding: 0;
}

/* Current time - position it first within plyr controls */
.fedora-audio-player-wrapper .plyr__time--current {
    order: -2;
    margin-right: 12px !important;
}

/* Progress control container */
.fedora-audio-player-wrapper .plyr__progress {
    order: -1;
    flex: 1;
    margin: 0 !important;
    position: relative;
    height: 24px !important;
    display: flex;
    align-items: center;
}

/* Progress range input */
.fedora-audio-player-wrapper .plyr__progress input[type=range] {
    width: 100% !important;
    height: 3px !important;
    background: #dddddd !important;
    border-radius: 0 !important;
    outline: none !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    cursor: pointer;
    position: relative;
}

/* Progress range track */
.fedora-audio-player-wrapper .plyr__progress input[type=range]::-webkit-slider-track {
    width: 100%;
    height: 3px;
    background: #dddddd;
    border-radius: 0;
    border: none;
}

.fedora-audio-player-wrapper .plyr__progress input[type=range]::-moz-range-track {
    width: 100%;
    height: 3px;
    background: #dddddd;
    border-radius: 0;
    border: none;
}

/* Progress range thumb (the black circle) */
.fedora-audio-player-wrapper .plyr__progress input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px !important;
    height: 12px !important;
    border-radius: 50% !important;
    background: #000000 !important;
    border: none !important;
    cursor: pointer;
    transition: transform 0.1s ease;
    position: relative;
    z-index: 10;
}

.fedora-audio-player-wrapper .plyr__progress input[type=range]::-moz-range-thumb {
    width: 12px !important;
    height: 12px !important;
    border-radius: 50% !important;
    background: #000000 !important;
    border: none !important;
    cursor: pointer;
    transition: transform 0.1s ease;
    position: relative;
    z-index: 10;
}

/* Progress range thumb hover */
.fedora-audio-player-wrapper .plyr__progress input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.fedora-audio-player-wrapper .plyr__progress input[type=range]::-moz-range-thumb:hover {
    transform: scale(1.1);
}

/* Duration time - position it after progress */
.fedora-audio-player-wrapper .plyr__time--duration {
    order: 0;
    margin-left: 12px !important;
}

/* Play/Pause button */
.fedora-audio-player-wrapper .plyr__control--overlaid,
.fedora-audio-player-wrapper .plyr__controls .plyr__control[data-plyr="play"] {
    order: 1;
    width: 16px !important;
    height: 16px !important;
    background: transparent !important;
    border: none !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
    margin-left: 12px !important;
    position: relative;
}

/* Hide the default SVG and use custom CSS icons */
.fedora-audio-player-wrapper .plyr__control svg {
    display: none !important;
}

/* Custom Play Icon */
.fedora-audio-player-wrapper .plyr__control[data-plyr="play"]:not(.plyr__tab-focus):not([aria-pressed="true"])::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-40%, -50%);
    width: 0;
    height: 0;
    border-left: 8px solid #000000;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
}

/* Custom Pause Icon */
.fedora-audio-player-wrapper .plyr__control[data-plyr="play"][aria-pressed="true"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 10px;
    background: linear-gradient(to right, #000000 2px, transparent 2px, transparent 4px, #000000 4px, #000000 6px, transparent 6px);
}

/* Hover effect */
.fedora-audio-player-wrapper .plyr__control[data-plyr="play"]:hover::after {
    opacity: 0.7;
}

/* Remove all other styling */
.fedora-audio-player-wrapper .plyr--audio {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Remove focus outlines and replace with our own */
.fedora-audio-player-wrapper .plyr__control:focus {
    outline: 1px solid #000000 !important;
    outline-offset: 2px !important;
}

.fedora-audio-player-wrapper .plyr__progress input[type=range]:focus {
    outline: 1px solid #000000 !important;
    outline-offset: 2px !important;
}

/* Placeholder styling */
.fedora-audio-player-placeholder {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

/* Loading state */
.fedora-audio-player-wrapper.loading .plyr__control {
    pointer-events: none;
    opacity: 0.6;
}

/* Error state */
.fedora-audio-player-wrapper.error .plyr__control {
    opacity: 0.5;
    pointer-events: none;
}

/* Responsive design */
@media (max-width: 480px) {
    .fedora-audio-player-wrapper .plyr--audio .plyr__controls {
        gap: 8px;
    }

    .fedora-audio-player-wrapper .plyr--audio .plyr__controls::before {
        width: 14px;
        height: 14px;
    }

    .fedora-audio-player-wrapper .plyr__time {
        font-size: 12px !important;
    }
}