/* Podcast Player Component Styles */

.podcast-player {
    background-color: var(--nmc-light-grey);
    overflow: hidden;
    font-family: var(--font-sans, sans-serif);
    max-width: 400px;
    display: flex;
    flex-direction: column;

    img {
        margin-top: initial;
        margin-bottom: initial;
    }

    /* WebKit (Chrome, Safari, Edge) */
    input[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none; /* REQUIRED */
        width: 14px;
        height: 14px;
        border-radius: 50%; /* makes it round */
        background: white;
        cursor: pointer;
        margin-top: 0px; /* align with track */
    }
}

.podcast-player p {
    font-family: var(--font-sans, sans-serif);
}

.podcast-player__header {
    display: flex;
    padding: 10px;
    gap: 10px;
    flex: 1;
}

.podcast-player__thumbnail {
    width: clamp(80px, 5%, 160px);
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: cover;
    flex-shrink: 0;
    cursor: pointer;
}

.podcast-player__thumbnail--play {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.podcast-player__info {
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

.podcast-player__category {
    font-size: 0.8rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.podcast-player__title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

/* Controls bar at the bottom */
.podcast-player__controls {
    background-color: var(--nmc-anthracite);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.podcast-player__time {
    font-size: 0.75rem;
    color: var(--nmc-light-grey);
    flex-shrink: 0;
    min-width: 32px;
    font-variant-numeric: tabular-nums;
}

.podcast-player__progress-wrap {
    flex: 1;
    height: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.podcast-player__progress-track {
    width: 100%;
    height: 4px;
    background-color: var(--nmc-grey);
    position: relative;
    overflow: hidden;
}

.podcast-player__progress-fill {
    height: 100%;
    background-color: var(--nmc-red);
    width: 0%;
    transition: width 0.1s linear;
}

.podcast-player__volume-btn {
    background: none;
    border: none;
    color: var(--nmc-light-grey);
    cursor: pointer;
    padding: 2px;
    line-height: 1;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.podcast-player__volume-btn:hover {
    color: var(--nmc-light-grey);
}

.podcast-player__play-btn {
    background: none;
    border: none;
    color: var(--nmc-light-grey);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    font-size: 1.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.podcast-player__play-btn:hover {
    color: var(--nmc-red);
}

.podcast-player__play-btn.is-buffering i {
    animation: podcast-spinner 1s linear infinite;
}

.podcast-player__play-btn.is-buffering i::before {
    content: "\F130"; /* bi-arrow-clockwise */
}

@keyframes podcast-spinner {
    to { transform: rotate(360deg); }
}

.podcast-player__volume-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}

.podcast-player__volume-slider {
    width: 60px;
    height: 4px;
    cursor: pointer;
    accent-color: var(--nmc-red);
    background: var(--nmc-grey);
    outline: none;
    -webkit-appearance: none;
}

.podcast-player__volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--nmc-light-grey);
    cursor: pointer;
}

.podcast-player__volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--nmc-light-grey);
    cursor: pointer;
    border: none;
}

/* Full-width variant for list page / standalone */
.podcast-player--full {
    max-width: 100%;
}

/* Compact variant for course page float */
.podcast-player--compact {
    max-width: 320px;
}

@media (max-width: 767.98px) {
    .podcast-player--compact {
        max-width: 100%;
    }
}

/* Carousel wrapper */
.podcast-carousel {
    position: relative;
}

.podcast-carousel__track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0 4px;
}

.podcast-carousel__track::-webkit-scrollbar {
    display: none;
}

.podcast-carousel__item {
    flex: 0 0 calc(33.333% - 11px);
    scroll-snap-align: start;
    min-width: 280px;
}

@media (max-width: 991.98px) {
    .podcast-carousel__item {
        flex: 0 0 calc(50% - 8px);
    }
}

@media (max-width: 575.98px) {
    .podcast-carousel__item {
        flex: 0 0 90%;
    }
}

.podcast-carousel__nav {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}

.podcast-carousel__nav--prev {
    left: -50px;
    background-color: var(--nmc-light-grey);
}

.podcast-carousel__nav--next {
    right: -50px;
    background-color: var(--nmc-light-grey);
}

@media (max-width: 575.98px) {
    .podcast-carousel__nav--prev {
        left: 0px;
    }
    .podcast-carousel__nav--next {
        right: 0px;
    }
}

.podcast-carousel__nav:hover {
    background: var(--bs-btn-hover-bg);
}

.podcast-carousel__nav:disabled {
    cursor: default;
}
