body {
    margin: 0;
    padding: 0;
    justify-content: center;
    align-items: center;
    height: 200px;
    background-color: #f0f0f0;
}

#vid {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 80vh;
    border-radius: 10px;
    object-fit: contain;
}

#aud {
    width: 100%;
    border-radius: 2px;
}

.plyr--video {
    max-height: 80vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.plyr--video video {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

/* Plyr video wrapper - allow it to adapt to video aspect ratio */
.plyr__video-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.plyr__video-wrapper video {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

/* Container that can adapt to video aspect ratio */
.video-plyr {
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-plyr .plyr--video {
    max-height: 50vh;
    width: 100%;
}

.video-plyr video {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 50vh;
    object-fit: contain;
}

.plyr--full-ui {
    --plyr-color-main: #ff751f;
    --plyr-range-thumb-active-shadow-width: 4px;
    --plyr-video-background: rgba(0, 0, 0, 0);
    --plyr-video-controls-background: linear-gradient(
        rgba(0, 0, 0, 0),
        rgba(79, 79, 79, 0.577)
    );
    --plyr-audio-controls-background: #cccccc5d;
    width: 100%;
    border-radius: 15px;
}

/* ========================================
   Audio Player Custom Styles
   ======================================== */

/* Controls container - Grid layout for two-row design */
.plyr--audio .plyr__controls {
    display: grid;
    grid-template-columns: auto auto auto 1fr auto auto;
    grid-template-rows: auto auto;
    gap: 4px;
    row-gap: 1px;
    column-gap: 4px;
    padding: 12px 16px 0 16px;
    align-items: center;
    background-color: transparent !important;
}

/* Row 1 Left: Playback controls (columns 1-3) */
.plyr--audio .plyr__control[data-plyr="rewind"] {
    grid-row: 1;
    grid-column: 1;
    padding: 2px;
    margin-right: 0;
}

.plyr--audio .plyr__control[data-plyr="play"] {
    grid-row: 1;
    grid-column: 2;
    padding: 2px;
    margin: 0 4px;
}

.plyr--audio .plyr__control[data-plyr="fast-forward"] {
    grid-row: 1;
    grid-column: 3;
    padding: 2px;
    margin-left: 0;
    margin-right: 12px;
}

/* Row 1 Center: Progress/Seekbar - takes most space */
.plyr--audio .plyr__progress {
    grid-row: 1;
    grid-column: 4;
}

/* Row 1 Right: Volume controls */
.plyr--audio .plyr__control[data-plyr="mute"] {
    grid-row: 1;
    grid-column: 5;
}

.plyr--audio .plyr__volume {
    grid-row: 1;
    grid-column: 6;
    max-width: 80px;
}

/* Row 2: Time displays - span across center columns */
.plyr__controls .plyr__controls__item.plyr__time {
    padding: 0;
    margin-right: 2px;
}
.plyr--audio .plyr__time--current {
    grid-row: 2;
    grid-column: 2 / 6;
    justify-self: center;
    margin-right: 8px;
}
.plyr__time + .plyr__time:before {
    margin: 0 2px;
}
.plyr--audio .plyr__time--duration {
    grid-row: 2;
    grid-column: 4 / 6;
    justify-self: center;
    margin-left: 8px;
}

/* Play button - larger size */
.plyr--audio .plyr__control[data-plyr="play"] {
    width: 38px;
    height: 60px;
    margin: 0;
    flex-shrink: 0;
    color: #ff751f;
    transition: transform 0.1s ease;
}

.plyr--audio .plyr__control[data-plyr="play"] svg {
    width: 36px;
    height: 36px;
    fill: #ff751f;
}

.plyr--audio .plyr__control[data-plyr="play"]:hover {
    background: transparent !important;
}

.plyr--audio .plyr__control[data-plyr="play"]:active {
    transform: scale(0.9);
}

/* Rewind button animation */
.plyr--audio .plyr__control[data-plyr="rewind"] {
    transition: transform 0.1s ease;
}

.plyr--audio .plyr__control[data-plyr="rewind"]:active {
    transform: scale(0.9);
}

/* Fast forward button animation */
.plyr--audio .plyr__control[data-plyr="fast-forward"] {
    transition: transform 0.1s ease;
}

.plyr--audio .plyr__control[data-plyr="fast-forward"]:active {
    transform: scale(0.9);
}

.plyr--audio .plyr__progress {
    position: relative;
    flex: 1;
    margin: 0;
    display: flex;
    align-items: center;
    background: rgba(150, 150, 150, 0.5);
    --plyr-progress: 0%;
}

.plyr--audio .plyr__progress input[type="range"] {
    position: relative;
    height: 48px;
    width: 100%;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    z-index: 3;
}

/* Hide progress buffer */
.plyr--audio .plyr__progress__buffer {
    display: none;
}

/* Range track styling - webkit browsers */
.plyr--audio
    .plyr__progress
    input[type="range"]::-webkit-slider-runnable-track {
    height: 48px;
    background: transparent;
}

/* Range track styling - mozilla browsers */
.plyr--audio .plyr__progress input[type="range"]::-moz-range-track {
    height: 48px;
    background: transparent;
}

/* Orange progress bar - solid bar that moves behind the slits */
.plyr--audio .plyr__progress::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 48px;
    width: var(--plyr-progress);
    background: #ff751f;
    pointer-events: none;
    z-index: 1;
    transition: width 0.2s ease-out;
}

/* Vertical slits overlay - transparent slits reveal gray/orange underneath */
.plyr--audio .plyr__progress::after {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 48px;
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 2px,
        #ffffff 2px,
        #ffffff 6px
    );
    pointer-events: none;
    z-index: 2;
    opacity: 0.7;
}

/* Slider thumb - webkit browsers */
.plyr--audio .plyr__progress input[type="range"]::-webkit-slider-thumb {
    position: relative;
    height: 56px;
    width: 4px;
    background: #ff751f;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 3;
    border: none;
    border-radius: 5px;
}

/* Slider thumb - mozilla browsers */
.plyr--audio .plyr__progress input[type="range"]::-moz-range-thumb {
    position: relative;
    height: 56px;
    width: 4px;
    background: #ff751f;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 3;
    border: none;
    border-radius: 5px;
}

/* Time display */
.plyr--audio .plyr__time {
    margin: 0;
    flex-shrink: 0;
    min-width: 45px;
    text-align: center;
}

/* Volume control */
.plyr--audio .plyr__volume {
    margin: 0;
    flex-shrink: 0;
}

/* Hide volume slider, keep only mute button */
.plyr--audio .plyr__volume input[type="range"] {
    display: none !important;
}

/* Other controls - prevent shrinking */
.plyr--audio .plyr__control {
    flex-shrink: 0;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.overlay-content {
    background: white;
    text-align: center;
}

.overlay-content h2 {
    margin-top: 0;
}

.overlay-content button {
    /* padding: 10px 20px; */
    background: #800080;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.overlay-content button:hover {
    background: #600060;
}

/* This was affecting taliwind's hidden class hierarchy */
/* .hidden {
    display: none;
} */

/* Mute overlay button */
.mute-overlay {
    position: absolute;
    bottom: 60px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
}

.mute-overlay.hidden {
    display: none;
}

.aspect-video {
    position: relative;
}

.aspect-video:has(.plyr--video),
.aspect-video:has(#vid),
.aspect-video:has(video) {
    aspect-ratio: auto !important;
    min-height: 200px;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aspect-video .plyr--video,
.aspect-video #vid,
.aspect-video video {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

/* Center video when in fullscreen mode */
.plyr--fullscreen-active .plyr__video-wrapper,
.plyr--fullscreen-active .plyr--video {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.plyr--fullscreen-active .plyr__video-wrapper video,
.plyr--fullscreen-active .plyr--video video {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.aspect-audio {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* Tablet breakpoint (768px and below) */
@media (max-width: 768px) {
    /* 4-column grid: Play, Seekbar, Mute, Settings */
    .plyr--audio .plyr__controls {
        grid-template-columns: auto 1fr auto auto;
        column-gap: 8px;
        padding: 12px 12px 8px 12px;
    }

    /* Play button - slightly smaller but still touch-friendly */
    .plyr--audio .plyr__control[data-plyr="play"] {
        grid-row: 1;
        grid-column: 1;
        width: 44px;
        height: 52px;
    }

    .plyr--audio .plyr__control[data-plyr="play"] svg {
        width: 28px;
        height: 28px;
    }

    /* Seekbar - takes center, full width */
    .plyr--audio .plyr__progress {
        grid-row: 1;
        grid-column: 2;
    }

    /* Hide rewind and forward buttons on mobile */
    .plyr--audio .plyr__control[data-plyr="rewind"],
    .plyr--audio .plyr__control[data-plyr="fast-forward"] {
        display: none;
    }

    /* Mute button - column 3 */
    .plyr--audio .plyr__control[data-plyr="mute"] {
        grid-row: 1;
        grid-column: 3;
        margin: 0;
        padding: 2px;
    }

    /* Settings button - column 4 */
    .plyr--audio .plyr__control[data-plyr="settings"] {
        grid-row: 1;
        grid-column: 4;
        margin: 0;
        padding: 2px;
    }

    /* Time displays - using 4-column subgrid concept for row 2 */
    /* Both times sit in center, creating 4 logical zones: [spacer][current][duration][spacer] */
    .plyr__controls .plyr__controls__item.plyr__time--current {
        grid-row: 2;
        grid-column: 1 / 3;
        justify-self: center;
        margin-right: 5%;
    }

    .plyr__controls .plyr__controls__item.plyr__time--duration {
        grid-row: 2;
        grid-column: 2 / 4;
        justify-self: center;
        margin-left: 4px;
    }
}

/* Phone breakpoint (480px and below) - extra optimizations */
@media (max-width: 480px) {
    .plyr--audio .plyr__controls {
        padding: 10px 8px 6px 8px;
        column-gap: 6px;
    }

    /* Slightly reduce play button for very small screens */
    .plyr--audio .plyr__control[data-plyr="play"] {
        width: 44px;
        height: 48px;
    }

    .plyr--audio .plyr__control[data-plyr="play"] svg {
        width: 26px;
        height: 26px;
    }

    /* Optimize seekbar for small screens - slightly reduce height */
    .plyr--audio .plyr__progress input[type="range"] {
        height: 44px;
    }

    .plyr--audio
        .plyr__progress
        input[type="range"]::-webkit-slider-runnable-track,
    .plyr--audio .plyr__progress input[type="range"]::-moz-range-track {
        height: 44px;
    }

    .plyr--audio .plyr__progress::before,
    .plyr--audio .plyr__progress::after {
        height: 44px;
    }

    /* Slightly smaller scrubber for phones */
    .plyr--audio .plyr__progress input[type="range"]::-webkit-slider-thumb,
    .plyr--audio .plyr__progress input[type="range"]::-moz-range-thumb {
        height: 52px;
    }

    /* Compact time display */
    .plyr--audio .plyr__time {
        min-width: 40px;
        font-size: 13px;
    }
    .plyr__controls .plyr__controls__item.plyr__time--current {
        margin-right: 0;
    }
}

/* Force mute button to always be visible on mobile for both video and audio */
@media (max-width: 768px) {
    .plyr__control[data-plyr="mute"],
    .plyr--video .plyr__control[data-plyr="mute"],
    .plyr--audio .plyr__control[data-plyr="mute"] {
        display: block !important;
    }
}
