.v-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99999;
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.96);
    opacity: 0;
    backdrop-filter: blur(12px);
    touch-action: none;
    transition: opacity 0.3s;
}

.v-modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* Forms share a lighter backdrop; image and video viewers keep the media backdrop. */
.v-modal-overlay:has(.v-mode-html) {
    --modal-overlay-color: var(--color-black);
    --modal-overlay-opacity: 60%;
    --modal-overlay-blur: 4px;
    background: color-mix(in srgb, var(--modal-overlay-color) var(--modal-overlay-opacity), transparent);
    backdrop-filter: blur(var(--modal-overlay-blur));
    touch-action: pan-y;
}

.v-modal-container {
    position: relative;
    width: 95%;
    max-width: 1000px;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.v-modal-container:has(.v-mode-image) {
    min-width: 0;
    margin-inline: 16px;
}

.v-modal-overlay.active .v-modal-container {
    transform: scale(1);
}

#vBoxBody {
    position: relative;
    display: flex;
    min-height: 200px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 24px;
    background: #000;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.v-mode-video {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
}

.v-mode-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.v-mode-image img {
    display: block;
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
}

.v-mode-html {
    position: relative;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 24px;
    color: #111;
    background: #fff;
}

/* HTML can exceed the viewport: keep its beginning reachable and scroll its full height. */
#vBoxBody.v-mode-html {
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
}

.v-btn {
    position: absolute;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    color: #fff;
    transition: 0.2s;
}

.v-close {
    top: -2.25rem;
    right: -2.25rem;
    z-index: 101;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
}

.v-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.v-nav {
    top: 50%;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-50%);
}

.v-prev {
    left: -70px;
}

.v-next {
    right: -70px;
}

.v-counter {
    position: absolute;
    bottom: -40px;
    left: 0;
    width: 100%;
    color: #666;
    font-size: 13px;
    letter-spacing: 2px;
    text-align: center;
}

body.v-open {
    overflow: hidden;
}

@media (max-width: 1200px) {
    .v-prev {
        left: 20px;
        background: rgba(0, 0, 0, 0.5);
    }

    .v-next {
        right: 20px;
        background: rgba(0, 0, 0, 0.5);
    }
}

@media (max-width: 768px) {
    .v-nav {
        top: auto !important;
        bottom: 20px !important;
        transform: none !important;
    }

    .v-prev {
        left: 20px !important;
        background: rgba(0, 0, 0, 0.6) !important;
    }

    .v-next {
        right: 20px !important;
        background: rgba(0, 0, 0, 0.6) !important;
    }

    .v-close {
        top: 10px;
        right: 10px;
        border-radius: 50%;
        background: rgba(0, 0, 0, 0.5);
    }
}

.v-confirm-box {
    padding: 40px;
    text-align: center;
}

.v-confirm-text {
    margin-bottom: 2rem;
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: bold;
}

.v-confirm-btns {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.v-confirm-btn {
    padding: 10px 24px;
    cursor: pointer;
    border: 0;
    border-radius: 12px;
    font-weight: bold;
    transition: 0.2s;
}

.v-btn-ok {
    color: #fff;
    background: #4f46e5;
}

.v-btn-cancel {
    color: #64748b;
    background: #f1f5f9;
}
