/* ============================================================
   Villa Terraglio – Video Plugin  |  Frontend Stylesheet
   Mobile-first, ottimizzato per smartphone e tablet
   ============================================================ */

/* ── Variabili ───────────────────────────────────────────── */
:root {
    --vt-gold:      #b08d5a;
    --vt-gold-dark: #8a6c3e;
    --vt-dark:      #2c3e50;
    --vt-bg:        #faf8f5;
    --vt-border:    #e8e0d4;
    --vt-radius:    10px;
    --vt-shadow:    0 2px 12px rgba(44,62,80,.10);
    --vt-transition: .22s cubic-bezier(.4,0,.2,1);
}

/* ── Wrap ─────────────────────────────────────────────────── */
.vt-frontend-wrap {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 4px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

/* ── Selettore lingua ─────────────────────────────────────── */
.vt-lang-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    padding: 10px 12px;
    background: var(--vt-bg);
    border-radius: var(--vt-radius);
    border: 1px solid var(--vt-border);
}

.vt-lang-btn {
    background: #fff;
    border: 1px solid var(--vt-border);
    border-radius: 6px;
    padding: 5px 9px;
    font-size: 18px;
    cursor: pointer;
    transition: transform var(--vt-transition), box-shadow var(--vt-transition), border-color var(--vt-transition);
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}
.vt-lang-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(176,141,90,.25);
}
.vt-lang-btn.vt-lang-active {
    border-color: var(--vt-gold);
    box-shadow: 0 0 0 2px rgba(176,141,90,.35);
    transform: scale(1.18);
    background: #fff9f1;
}

/* ── Indice video ─────────────────────────────────────────── */
.vt-index {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vt-item-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    background: #fff;
    border: 1px solid var(--vt-border);
    border-radius: var(--vt-radius);
    padding: 16px 14px;
    cursor: pointer;
    text-align: left;
    transition: background var(--vt-transition), box-shadow var(--vt-transition), border-color var(--vt-transition), transform var(--vt-transition);
    box-shadow: var(--vt-shadow);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.vt-item-btn:hover,
.vt-item-btn:focus-visible {
    background: #fff9f1;
    border-color: var(--vt-gold);
    box-shadow: 0 4px 18px rgba(176,141,90,.2);
    transform: translateY(-1px);
    outline: none;
}
.vt-item-btn:active {
    transform: scale(.98);
    background: #f5ede0;
}

.vt-item-num {
    font-size: 12px;
    font-weight: 700;
    color: var(--vt-gold);
    letter-spacing: .04em;
    min-width: 24px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.vt-item-title {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: var(--vt-dark);
    line-height: 1.4;
    word-break: break-word;
}

.vt-item-play {
    color: var(--vt-gold);
    font-size: 16px;
    flex-shrink: 0;
    transition: transform var(--vt-transition);
}
.vt-item-btn:hover .vt-item-play {
    transform: scale(1.3) translateX(2px);
}

/* ── Media overlay ───────────────────────────────────────── */
#vt-player-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.88);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    animation: vtFadeIn .2s ease;
}

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

/* ── Media box ───────────────────────────────────────────── */
#vt-player-box {
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    max-width: 640px;
    box-shadow: 0 24px 80px rgba(0,0,0,.7);
    animation: vtSlideUp .22s cubic-bezier(.4,0,.2,1);
}

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

/* ── Media header ────────────────────────────────────────── */
#vt-player-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: rgba(176,141,90,.15);
    border-bottom: 1px solid rgba(176,141,90,.25);
    gap: 10px;
}
#vt-player-title {
    flex: 1;
    color: #f0e8d8;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#vt-player-close {
    background: rgba(255,255,255,.1);
    border: none;
    color: #fff;
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 15px;
    flex-shrink: 0;
    transition: background var(--vt-transition);
    -webkit-tap-highlight-color: transparent;
}
#vt-player-close:hover { background: rgba(255,255,255,.22); }

/* ── Media body ──────────────────────────────────────────── */
#vt-player-body {
    position: relative;
    background: #000;
}
#vt-video-el,
#vt-image-el {
    display: block;
    width: 100%;
    max-height: 70vh;
    background: #000;
    border: none;
    outline: none;
}
#vt-image-el {
    height: auto;
    object-fit: contain;
}
#vt-pdf-el {
    display: block;
    width: 100%;
    height: 70vh;
    background: #fff;
    border: none;
    outline: none;
}
#vt-file-fallback {
    padding: 12px 16px 16px;
    background: #111;
    color: #f0e8d8;
    text-align: center;
}
#vt-file-fallback p {
    margin: 0 0 8px;
}
#vt-file-link {
    color: #f0e8d8;
    font-weight: 700;
    text-decoration: underline;
}

/* ── Loader spinner ──────────────────────────────────────── */
#vt-player-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.6);
    pointer-events: none;
}
.vt-spinner {
    width: 44px; height: 44px;
    border: 4px solid rgba(176,141,90,.25);
    border-top-color: var(--vt-gold);
    border-radius: 50%;
    animation: vtSpin .8s linear infinite;
}
@keyframes vtSpin { to { transform: rotate(360deg); } }

/* ── No videos ───────────────────────────────────────────── */
.vt-no-videos { color: #999; font-style: italic; padding: 20px 0; }

/* ── Tablet ──────────────────────────────────────────────── */
@media (min-width: 480px) {
    .vt-item-btn { padding: 18px 18px; }
    .vt-item-title { font-size: 16px; }
    #vt-player-title { font-size: 15px; }
}
