/* yt-chapters-widget/assets/widget.css — v1.3.0 */

/* ── Wrapper ── */
.ytcw-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    overflow: hidden;
    max-width: 100%;
}

/* ── Player ── */
.ytcw-player-area {
    background: #000;
    width: 100%;
}
.ytcw-video-title {
    padding: 10px 14px 8px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ytcw-player-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
}
.ytcw-player-wrap > div,
.ytcw-player-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    border: none;
}

/* ── Chapters area ── */
.ytcw-chapters-area {
    padding: 16px 16px 20px;
    background: #f5f5f5;
}

/* ── Header row ── */
.ytcw-chapters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    min-height: 28px;
}
.ytcw-chapters-heading {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #111;
    line-height: 1;
}

/* ── Now-playing badge ── */
.ytcw-now-playing {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #555;
    overflow: hidden;
    max-width: 60%;
}
.ytcw-np-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0066cc;
    animation: ytcw-pulse 1.2s ease-in-out infinite;
}
@keyframes ytcw-pulse {
    0%, 100% { opacity: 1;   transform: scale(1);   }
    50%       { opacity: 0.4; transform: scale(0.75); }
}
.ytcw-np-title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Carousel outer — clips overflow, positions nav buttons ── */
.ytcw-carousel-outer {
    position: relative;
}

/* ── Track: horizontal scroll, hidden scrollbar ── */
.ytcw-carousel-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px; /* room for box-shadow on cards */
}
.ytcw-carousel-track::-webkit-scrollbar {
    display: none;
}

/* ── Card ── */
.ytcw-card {
    width: 180px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    outline: 2px solid transparent;
    outline-offset: 2px;
    transition: transform 0.15s, outline-color 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.ytcw-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.ytcw-card.is-active {
    outline-color: #0066cc;
    box-shadow: 0 4px 14px rgba(0,102,204,0.25);
}
.ytcw-card:focus-visible {
    outline-color: #0066cc;
}

/* ── Thumbnail wrapper (16:9) ── */
.ytcw-card-thumb-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #1a1a1a;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}
.ytcw-card-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Timestamp badge — bottom-left, same style as YouTube */
.ytcw-card-time {
    position: absolute;
    bottom: 5px;
    left: 6px;
    background: rgba(0,0,0,0.75);
    color: #4da6ff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    font-variant-numeric: tabular-nums;
    line-height: 1.6;
    letter-spacing: 0.3px;
}
.ytcw-card.is-active .ytcw-card-time {
    color: #4da6ff;
}

/* ── Card info ── */
.ytcw-card-info {
    padding: 8px 10px 10px;
}
.ytcw-card-label {
    font-size: 13px;
    font-weight: 500;
    color: #111;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ytcw-card.is-active .ytcw-card-label {
    font-weight: 700;
}

/* ── Nav buttons ── */
.ytcw-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-65%); /* slightly above mid to align with thumb */
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #0066cc;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    transition: background 0.15s, transform 0.15s;
    padding: 0;
}
.ytcw-carousel-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-65%) scale(1.08);
}
.ytcw-carousel-btn--prev { left:  -14px; }
.ytcw-carousel-btn--next { right: -14px; }

/* hide buttons when not needed */
.ytcw-carousel-btn[disabled] {
    opacity: 0.3;
    pointer-events: none;
}

/* ── Misc ── */
.ytcw-placeholder,
.ytcw-error {
    padding: 16px;
    font-size: 13px;
    color: #888;
    font-style: italic;
}
.ytcw-error { color: #c00; }

/* ── Custom play overlay ── */

.ytcw-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    cursor: pointer;
    transition: opacity 0.35s ease;
}

/* Thumbnail image fills the entire overlay */
.ytcw-overlay-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Play button sits above the thumbnail */
.ytcw-play-btn {
    position: relative;
    z-index: 1;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    padding: 0;
}
.ytcw-play-overlay:hover .ytcw-play-btn {
    background: rgba(0,0,0,0.8);
    transform: scale(1.08);
}
.ytcw-play-overlay:active .ytcw-play-btn {
    transform: scale(0.96);
}
.ytcw-play-btn svg {
    width: 60%;
    height: 60%;
    display: block;
    flex-shrink: 0;
}
/* Play icon offset to visually center the triangle */
.ytcw-icon-play {
    transform: translateX(7%);
}

/* Hidden permanently after first play */
.ytcw-play-overlay.is-active {
    display: none;
}

/* ── Sticky (floating) player on scroll ── */

/* When active, the player detaches and floats over the page.
   min-height is applied to .ytcw-player-area by JS so the page
   layout doesn't jump when the player leaves the flow. */
.ytcw-sticky-active .ytcw-player-wrap {
    position: fixed;
    z-index: 9999;
    width: 340px;
    max-width: 80vw;
    height: auto;
    padding-top: 0;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    animation: ytcw-sticky-in 0.25s ease;
}

@keyframes ytcw-sticky-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0);    }
}

/* Corner positions (class set on the wrapper by PHP) */
.ytcw-sticky-active.ytcw-sticky-br .ytcw-player-wrap { bottom: 20px; right: 20px; }
.ytcw-sticky-active.ytcw-sticky-bl .ytcw-player-wrap { bottom: 20px; left:  20px; }
.ytcw-sticky-active.ytcw-sticky-tr .ytcw-player-wrap { top:    20px; right: 20px; }
.ytcw-sticky-active.ytcw-sticky-tl .ytcw-player-wrap { top:    20px; left:  20px; }

/* Close button — injected by JS, only visible while floating */
.ytcw-sticky-close {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.ytcw-sticky-close:hover {
    background: rgba(0, 0, 0, 0.85);
}
.ytcw-sticky-active .ytcw-sticky-close {
    display: flex;
}

@media (max-width: 480px) {
    .ytcw-sticky-active .ytcw-player-wrap { width: 240px; }
}
.elementor-widget-yt_chapters_widget {
    z-index: 10001;
}