/* ===========================================
   Video Thumbnail Player — WordPress Plugin
   =========================================== */

/* Root container */
.vtp-root {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---- Thumbnail Wrapper ---- */
.vtp-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 8px 32px rgba(0, 0, 0, 0.55),
        0 24px 64px rgba(0, 0, 0, 0.40);
    outline: none;
    transform: scale(1);
    transition:
        transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.35s ease;
    -webkit-user-select: none;
    user-select: none;
}

.vtp-wrapper:hover,
.vtp-wrapper:focus-visible {
    transform: scale(1.025);
    box-shadow:
        0 0 0 2px rgba(120, 160, 255, 0.3),
        0 12px 48px rgba(0, 0, 0, 0.65),
        0 32px 80px rgba(30, 80, 200, 0.25);
}

/* ---- Thumbnail Image ---- */
.vtp-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease, filter 0.35s ease;
    pointer-events: none;
}

.vtp-wrapper:hover .vtp-img,
.vtp-wrapper:focus-visible .vtp-img {
    transform: scale(1.04);
    filter: brightness(0.88);
}

/* ---- Overlay ---- */
.vtp-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(5, 5, 20, 0.80) 0%,
        rgba(5, 5, 20, 0.25) 40%,
        rgba(5, 5, 20, 0.10) 70%,
        transparent 100%
    );
    transition: background 0.35s ease;
    pointer-events: none;
}

.vtp-wrapper:hover .vtp-overlay,
.vtp-wrapper:focus-visible .vtp-overlay {
    background: linear-gradient(
        to top,
        rgba(5, 5, 20, 0.88) 0%,
        rgba(5, 5, 20, 0.35) 40%,
        rgba(5, 5, 20, 0.18) 70%,
        rgba(5, 5, 20, 0.05) 100%
    );
}

/* ---- Duration Badge ---- */
.vtp-duration-badge {
    position: absolute;
    top: 14px;
    right: 16px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 3px 9px;
    border-radius: 5px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    pointer-events: none;
}

/* ---- Play Button ---- */
.vtp-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -52%);
    width: 78px;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.vtp-wrapper:hover .vtp-play-btn,
.vtp-wrapper:focus-visible .vtp-play-btn {
    transform: translate(-50%, -52%) scale(1.12);
}

.vtp-play-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px solid rgba(255, 255, 255, 0.35);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.40),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.vtp-wrapper:hover .vtp-play-btn::before,
.vtp-wrapper:focus-visible .vtp-play-btn::before {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.55);
}

.vtp-play-icon {
    position: relative;
    z-index: 2;
    width: 30px;
    height: 30px;
    fill: #ffffff;
    margin-left: 4px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

/* ---- Ripple ---- */
.vtp-ripple {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    animation: vtpRipplePulse 2.4s ease-out infinite;
    pointer-events: none;
}

.vtp-ripple--delay {
    animation-delay: 1.2s;
}

@keyframes vtpRipplePulse {
    0%   { transform: scale(1);   opacity: 0.6; }
    100% { transform: scale(2.2); opacity: 0;   }
}

/* ---- Caption Bar ---- */
.vtp-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 24px 22px;
    display: flex;
    align-items: flex-end;
    gap: 14px;
    pointer-events: none;
}

.vtp-caption__logo {
    flex-shrink: 0;
    background: rgba(20, 55, 160, 0.75);
    border: 1px solid rgba(100, 140, 255, 0.35);
    border-radius: 8px;
    padding: 6px 12px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.vtp-caption__logo strong {
    font-weight: 700;
}

.vtp-caption__info {
    flex: 1;
}

.vtp-caption__title {
    color: #ffffff;
    font-size: clamp(0.95rem, 2vw, 1.25rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
    margin: 0 0 4px;
}

.vtp-caption__sub {
    color: rgba(200, 210, 240, 0.80);
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    margin: 0;
}

/* ---- Modal Backdrop ---- */
.vtp-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: vtpFadeIn 0.25s ease;
}

.vtp-modal-backdrop[hidden] {
    display: none;
}

@keyframes vtpFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---- Modal Box ---- */
.vtp-modal-box {
    position: relative;
    width: min(900px, 95vw);
    background: #0d0d1a;
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 32px 80px rgba(0, 0, 0, 0.70);
    animation: vtpSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes vtpSlideUp {
    from { transform: translateY(30px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

.vtp-video {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    background: #000;
}

/* ---- Close Button ---- */
.vtp-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    line-height: 1;
    padding: 0;
}

.vtp-modal-close:hover {
    background: rgba(255, 80, 80, 0.50);
    transform: scale(1.1) rotate(90deg);
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .vtp-play-btn {
        width: 60px;
        height: 60px;
    }

    .vtp-play-icon {
        width: 22px;
        height: 22px;
    }

    .vtp-caption {
        padding: 14px 16px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
