/**
 * video.css — Video View (Final Delivery)
 * Layout: identical pattern to preview-layout (space-evenly, flex:1)
 * Card: vcard from welcome.css, sizing override with formula D
 * Frames: reuses .preview-frame from preview.css
 * Architecture: ZERO inline CSS. SSR. External only.
 */

/* ═══ LAYOUT ═══ */
.vid-layout {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    gap: 0;
    width: 100%;
    height: 100%;
    flex: 1;
    align-self: stretch;
    padding: 53px 2.5rem 5px;
}

/* ═══ LEFT: VIDEO CARD ═══ */
.vid-card-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.vid-card-col .vcard {
    cursor: default;
}

/* Card sizing — formula D = calc((100vh - 224px) * 9/16) */
.vid-card-col .vcard.card-P .thumb {
    width: calc((100vh - 224px) * 9 / 16);
    height: auto;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.vid-card-col .vcard.card-L .thumb {
    height: calc((100vh - 224px) * 9 / 16);
    width: auto;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* ═══ CARD STATES (SSR: server adds class) ═══ */
/* Default: generating — product + orbs visible, first-frame + video hidden */
.vid-card-col .vcard .thumb img.first-frame,
.vid-card-col .vcard .thumb video {
    display: none;
}

/* State: first-frame ready */
.vid-card-col .vcard.vid-has-frame .thumb img.first-frame {
    display: block;
}
.vid-card-col .vcard.vid-has-frame .gen-anim,
.vid-card-col .vcard.vid-has-frame .status-text {
    display: none;
}

/* State: video ready */
.vid-card-col .vcard.vid-has-video .thumb video {
    display: block;
}
.vid-card-col .vcard.vid-has-video .gen-anim,
.vid-card-col .vcard.vid-has-video .status-text,
.vid-card-col .vcard.vid-has-video .thumb img.first-frame {
    display: none;
}

/* ═══ FRAME SIZING (direct children of vid-layout) ═══ */
.vid-layout > .preview-frame {
    max-width: 280px;
    width: 100%;
    flex-shrink: 0;
    position: relative;
}

/* Glow line — matches login-card-glow */
.vid-layout > .preview-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    width: 50%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.4), transparent);
}

/* Video frame — symmetric padding */
.vid-layout > .preview-frame:last-of-type {
    padding: 14px 20px;
}

/* ═══ MARKETING: COPY TAGS ═══ */
.vid-tag-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    width: 100%;
}

.vid-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.35rem 0.6rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(192,192,192,0.15);
    border-radius: 8px;
    transition: border-color 0.2s;
}

.vid-tag:hover {
    border-color: rgba(192,192,192,0.35);
}

.vid-tag-label {
    font-family: 'Inter', sans-serif;
    font-size: 7px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(192,192,192,0.4);
    flex-shrink: 0;
}

.vid-tag-text {
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    font-weight: 500;
    color: rgba(255,255,255,0.65);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vid-tag-copy {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: rgba(192,192,192,0.45);
    transition: color 0.2s, transform 0.15s;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.vid-tag-copy:hover {
    color: #fff;
    transform: scale(1.1);
}

.vid-tag-copy.copied {
    color: #6fcf97;
}

.vid-tag-copy svg {
    width: 14px;
    height: 14px;
}

/* ═══ VIDEO PANEL: HEADER ROW ═══ */
/* [9:16] [UGC]  VIDEO  (i) */
.vid-header-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
}

.vid-header-row .preview-frame-text {
    text-align: center;
}

.vid-badge {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(192,192,192,0.25);
    background: rgba(192,192,192,0.06);
    font-family: 'Inter', sans-serif;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(192,192,192,0.8);
}

.vid-info-btn {
    background: linear-gradient(135deg, #FFF 0%, #A0A0A0 100%);
    border: none;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #000;
    font-family: 'Inter', sans-serif;
    font-size: 7px;
    font-weight: 900;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.vid-info-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(255,255,255,0.2);
}

/* ═══ ACTION BUTTONS ═══ */
/* All buttons: same dimensions as .preview-btn-generate (48px, 14px radius) */
.vid-actions {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    width: 100%;
}

.vid-action-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    padding: 0 1.5rem;
    border-radius: 14px;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.vid-action-btn span,
.vid-action-btn svg {
    position: relative;
    z-index: 2;
}

.vid-action-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Descargar — pastel gradient (like GENERAR VIDEO) */
.vid-action-btn.vid-download {
    color: #000;
    background: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
}
.vid-action-btn.vid-download::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 10%, rgba(130, 190, 255, 0.7) 40%, rgba(255, 150, 190, 0.7) 60%, transparent 90%);
    background-size: 200% 200%;
    animation: previewPastelFlow 4s ease-in-out infinite;
    pointer-events: none;
}
.vid-action-btn.vid-download:hover {
    box-shadow: 0 4px 24px rgba(130, 190, 255, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Guardar Modelo — matches format-submit (Continuar) exactly */
.vid-action-btn.vid-save-model {
    height: auto;
    padding: 0.85rem 1.5rem;
    border-radius: 1rem;
    font-size: 11px;
    font-weight: 800;
    background: linear-gradient(135deg, #FFF 0%, #A0A0A0 100%);
    color: #000;
    box-shadow: none;
}
.vid-action-btn.vid-save-model:hover {
    transform: scale(1.03);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}
.vid-action-btn.vid-save-model svg.saved {
    fill: #000;
}

/* Publicar en Wall — matches format-submit (Continuar) exactly */
.vid-action-btn.vid-publish {
    height: auto;
    padding: 0.85rem 1.5rem;
    border-radius: 1rem;
    font-size: 11px;
    font-weight: 800;
    background: linear-gradient(135deg, #FFF 0%, #A0A0A0 100%);
    color: #000;
    box-shadow: none;
}
.vid-action-btn.vid-publish:hover {
    transform: scale(1.03);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

/* Disabled state */
.vid-action-btn:disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* ═══ FORMAT TOGGLE (dev only) ═══ */
.vid-format-toggle {
    position: absolute;
    bottom: 8px;
    left: 8px;
    z-index: 10;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(192,192,192,0.2);
    color: rgba(255,255,255,0.4);
    font-family: 'Inter', sans-serif;
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.vid-format-toggle:hover {
    color: #fff;
    border-color: rgba(192,192,192,0.5);
}

/* ═══ INFO MODAL ═══ */
.vid-info-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
}
.vid-info-modal.active { display: flex; }

.vid-info-content {
    position: relative;
    background: rgba(10,10,10,0.95);
    border: 1px solid rgba(192,192,192,0.4);
    border-radius: 1.25rem;
    padding: 2rem 1.75rem;
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.vid-info-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: none; border: none;
    color: rgba(255,255,255,0.5);
    font-size: 18px; cursor: pointer;
    transition: color 0.2s;
}
.vid-info-close:hover { color: #fff; }

.vid-info-content h3 {
    font-family: 'Inter', sans-serif;
    font-size: 12px; font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #fff;
    margin: 0 0 1.25rem 0;
}

.vid-info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(192,192,192,0.08);
}

.vid-info-label {
    font-family: 'Inter', sans-serif;
    font-size: 8px; font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(192,192,192,0.5);
    flex: 0 0 100px;
}

.vid-info-val {
    font-family: 'Inter', sans-serif;
    font-size: 10px; font-weight: 500;
    color: rgba(255,255,255,0.7);
    text-align: right; flex: 1;
}

/* ═══ SAVE MODEL MODAL ═══ */
.vid-save-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
}
.vid-save-modal.active { display: flex; }

.vid-save-content {
    position: relative;
    background: rgba(10,10,10,0.95);
    border: 1px solid rgba(192,192,192,0.4);
    border-radius: 1.25rem;
    padding: 2rem 1.75rem;
    max-width: 420px; width: 90%;
}

.vid-save-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: none; border: none;
    color: rgba(255,255,255,0.5);
    font-size: 18px; cursor: pointer;
    transition: color 0.2s;
}
.vid-save-close:hover { color: #fff; }

.vid-save-content h3 {
    font-family: 'Inter', sans-serif;
    font-size: 12px; font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #fff;
    margin: 0 0 1rem 0;
}

.vid-save-input {
    width: 100%;
    padding: 0.7rem 1rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(192,192,192,0.25);
    border-radius: 10px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 11px; font-weight: 500;
    letter-spacing: 0.1em;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    margin-bottom: 0.75rem;
}
.vid-save-input:focus { border-color: rgba(192,192,192,0.5); }
.vid-save-input::placeholder { color: rgba(255,255,255,0.3); }

.vid-save-existing { margin-bottom: 1rem; }

.vid-save-existing-title {
    font-family: 'Inter', sans-serif;
    font-size: 7px; font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(192,192,192,0.4);
    margin: 0 0 0.4rem 0;
}

.vid-save-existing-list {
    display: flex; flex-wrap: wrap; gap: 0.35rem;
}

.vid-save-existing-item {
    padding: 3px 8px; border-radius: 6px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(192,192,192,0.12);
    font-family: 'Inter', sans-serif;
    font-size: 8px; font-weight: 500;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.1em;
}

.vid-save-alert {
    display: none;
    padding: 0.5rem 0.75rem; border-radius: 8px;
    background: rgba(255, 180, 50, 0.1);
    border: 1px solid rgba(255, 180, 50, 0.25);
    font-family: 'Inter', sans-serif;
    font-size: 9px; font-weight: 600;
    color: rgba(255, 180, 50, 0.8);
    margin-bottom: 0.75rem;
}
.vid-save-alert.active { display: block; }

.vid-save-confirm {
    width: 100%; height: 48px;
    border-radius: 14px;
    font-size: 10px; letter-spacing: 0.2em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #FFF 0%, #A0A0A0 100%);
    color: #000; font-weight: 900;
    border: none; cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.3; pointer-events: none;
}
.vid-save-confirm.enabled { opacity: 1; pointer-events: auto; }
.vid-save-confirm.enabled:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 24px rgba(255,255,255,0.15);
}

/* ═══ TABLET (768px) ═══ */
@media (max-width: 768px) {
    .vid-layout {
        padding: 53px 1rem 5px;
    }
    .vid-card-col .vcard.card-P .thumb {
        width: calc((100vh - 224px) * 9 / 16 * 0.8);
    }
    .vid-card-col .vcard.card-L .thumb {
        height: calc((100vh - 224px) * 9 / 16 * 0.8);
    }
    .vid-layout > .preview-frame {
        max-width: 220px;
    }
}

/* ═══ MOBILE (480px) ═══ */
@media (max-width: 480px) {
    .vid-layout {
        flex-direction: column;
        align-items: center;
        justify-content: space-evenly;
        gap: 0;
        padding: 53px 1.5rem 5px;
    }
    .vid-card-col .vcard.card-P .thumb {
        width: calc((100vh - 224px) * 9 / 16 * 0.38);
    }
    .vid-card-col .vcard.card-L .thumb {
        height: calc((100vh - 224px) * 9 / 16 * 0.38);
    }
    .vid-layout > .preview-frame {
        max-width: 100%;
        width: 100%;
    }
}
