/* ================================================================
   Video Carousel Pro — Frontend Styles v1.2
   ================================================================ */

.vcp-carousel-wrapper *,
.vcp-carousel-wrapper *::before,
.vcp-carousel-wrapper *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Outer wrapper ── */
.vcp-carousel-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 32px;
    font-family: inherit;
}

/* ── Container: clips the track + anchors the absolute arrows ── */
.vcp-carousel-container {
    position: relative;
    overflow: hidden;
    width: 100%;
}

/* ── Track: flex row, animates with translateX ── */
.vcp-track {
    display: flex;
    gap: 16px;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* ── Slide: exactly 1/3 of the visible container ──
   Formula: (100% - 2 gaps of 16px) / 3  = calc(33.333% - 10.667px)
   We round to 10.67px but browsers handle sub-pixel fine.           */
.vcp-slide {
    flex: 0 0 calc(33.333% - 10.67px);
    min-width: 0;
    cursor: pointer;
}

/* ── Slide inner ── */
.vcp-slide-inner {
    border-radius: 6px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 2px 12px rgba(0,0,0,.12);
    transition: box-shadow 0.25s, transform 0.25s;
}
.vcp-slide-inner:hover {
    box-shadow: 0 10px 32px rgba(0,0,0,.22);
    transform: translateY(-3px);
}

/* ── Thumbnail — strict 16:9, every card identical height ── */
.vcp-thumb-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #111;
}
.vcp-thumb-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.38s ease, opacity 0.25s;
}
.vcp-slide-inner:hover .vcp-thumb-img { transform: scale(1.06); opacity: 0.72; }

/* ── Play overlay ── */
.vcp-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.10);
    transition: background 0.25s;
}
.vcp-slide-inner:hover .vcp-play-overlay { background: rgba(0,0,0,.32); }

.vcp-play-btn {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(255,255,255,.88);
    border: 2px solid rgba(255,255,255,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.22s, background 0.22s;
    box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.vcp-slide-inner:hover .vcp-play-btn { transform: scale(1.14); background: #fff; }
.vcp-play-btn svg { width: 22px; height: 22px; color: #111; margin-left: 3px; display: block; }

/* No title bar */
.vcp-slide-title { display: none; }

/* ══════════════════════════════════════════════════════════════
   ARROWS — absolute inside .vcp-carousel-container
   Invisible by default → fade in on .vcp-carousel-wrapper hover
══════════════════════════════════════════════════════════════ */
.vcp-arrow,
button.vcp-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    border-radius: 50% !important;
    background-color: rgba(255,255,255,.93) !important;
    background-image: none !important;
    border: none !important;
    outline: none !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #111;
    box-shadow: 0 2px 14px rgba(0,0,0,.18) !important;
    opacity: 0;
    pointer-events: none;
    padding: 0 !important;
    margin: 0 !important;
    transition: opacity 0.22s ease, background-color 0.18s, box-shadow 0.18s;
    -webkit-appearance: none;
    appearance: none;
}
/* Reveal on wrapper hover */
.vcp-carousel-wrapper:hover .vcp-arrow {
    opacity: 1;
    pointer-events: auto;
}
.vcp-arrow-left  { left: 12px; }
.vcp-arrow-right { right: 12px; }

.vcp-arrow:hover {
    background-color: #fff !important;
    box-shadow: 0 4px 20px rgba(0,0,0,.26) !important;
}
.vcp-arrow:active { opacity: 0.8; }
.vcp-arrow svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════
   DOTS — tiny circles, active = pill
══════════════════════════════════════════════════════════════ */
.vcp-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    min-height: 16px;
}

.vcp-dot,
button.vcp-dot,
.vcp-dots button.vcp-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    min-width: 8px;
    max-width: 8px;
    border-radius: 50% !important;
    background-color: #c0c0c0 !important;
    background-image: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 0 !important;
    font-size: 0 !important;
    transition: background-color 0.22s, width 0.22s, border-radius 0.22s;
    -webkit-appearance: none;
    appearance: none;
}
.vcp-dot.active,
button.vcp-dot.active {
    width: 22px !important;
    max-width: 22px !important;
    border-radius: 4px !important;
    background-color: #333 !important;
}
.vcp-dot:hover:not(.active),
button.vcp-dot:hover:not(.active) { background-color: #888 !important; }

/* ══════════════════════════════════════════════════════════════
   LIGHTBOX
══════════════════════════════════════════════════════════════ */
.vcp-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
}
.vcp-lightbox.vcp-lb-open { display: flex; }

.vcp-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.9);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.vcp-lightbox-content {
    position: relative;
    z-index: 1;
    width: 70vw;
    max-width: 70vw;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 32px 96px rgba(0,0,0,.7);
    animation: vcpLbIn 0.28s cubic-bezier(0.34,1.36,0.64,1) both;
}
@keyframes vcpLbIn {
    from { transform: scale(0.9); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.vcp-lightbox-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    border: none;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: background 0.2s;
}
.vcp-lightbox-close:hover { background: rgba(255,255,255,.28); }
.vcp-lightbox-close svg { width: 18px; height: 18px; }

.vcp-lightbox-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}
.vcp-player-inner { position: absolute; inset: 0; }
.vcp-player-inner iframe,
.vcp-player-inner video { width: 100%; height: 100%; border: none; display: block; }

/* ══════════════════════════════════════════════════════════════
   ADMIN TOOLBAR (visible to editors/admins on frontend)
══════════════════════════════════════════════════════════════ */
.vcp-admin-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 10px;
}
.vcp-admin-btn {
    padding: 5px 14px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.15s;
    text-decoration: none;
    color: #333;
    line-height: 1.5;
}
.vcp-admin-btn:hover                { background: #f0f0f0; border-color: #bbb; }
.vcp-admin-btn.vcp-btn-primary      { background: #1a1a2e; color: #fff; border-color: #1a1a2e; }
.vcp-admin-btn.vcp-btn-primary:hover{ background: #2d2d4e; }
.vcp-admin-btn.vcp-btn-danger       { background: #cc1818; color: #fff; border-color: #cc1818; }
.vcp-admin-btn.vcp-btn-danger:hover { background: #aa0000; }

/* Slide edit overlay (shows on hover in edit mode) */
.vcp-slide-edit-overlay {
    position: absolute;
    inset: 0;
    background: rgba(26,26,46,.75);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 5;
}
.vcp-slide:hover .vcp-slide-edit-overlay.vcp-edit-mode { display: flex; }

/* Edit/Add modals */
.vcp-edit-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000000;
    background: rgba(0,0,0,.6);
    align-items: center;
    justify-content: center;
}
.vcp-edit-modal-backdrop.open { display: flex; }
.vcp-edit-modal {
    background: #fff;
    border-radius: 8px;
    width: 500px;
    max-width: 95vw;
    padding: 24px;
    box-shadow: 0 16px 60px rgba(0,0,0,.3);
}
.vcp-edit-modal h3 { margin: 0 0 18px; font-size: 16px; color: #1a1a2e; border-bottom: 1px solid #eee; padding-bottom: 12px; }
.vcp-edit-field { margin-bottom: 14px; }
.vcp-edit-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: #333; }
.vcp-edit-field input { width: 100%; padding: 8px 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; }
.vcp-edit-field input:focus { outline: none; border-color: #1a1a2e; box-shadow: 0 0 0 2px rgba(26,26,46,.14); }
.vcp-edit-modal-thumb-preview { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; margin-top: 8px; border: 1px solid #ddd; display: none; }
.vcp-edit-modal-thumb-preview.visible { display: block; }
.vcp-edit-modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid #eee; }
.vcp-status-msg { font-size: 12px; color: #888; align-self: center; margin-right: auto; }
.vcp-status-msg.success { color: #2e7d32; }
.vcp-status-msg.error   { color: #cc1818; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .vcp-slide { flex: 0 0 calc(50% - 8px); }
    .vcp-lightbox-content { width: 95vw; max-width: 95vw; }
}
@media (max-width: 480px) {
    .vcp-slide { flex: 0 0 100%; }
}
