/**
 * Análisis Forense de Vídeo — estilos del módulo
 * Depende de los tokens de /css/common.css (--bg-card, --accent-primary, …)
 */

.vf {
    /* Tokens locales del módulo */
    --vf-radius: 10px;
    --vf-radius-sm: 6px;
    --vf-gap: 1rem;
    --vf-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --vf-speed: 220ms;
    --vf-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --vf-display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;

    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
}

/* ── Cabecera ──────────────────────────────────────────────────────── */
.vf-hero {
    margin-bottom: 1.5rem;
}

.vf-hero h1 {
    font-family: var(--vf-display);
    font-size: clamp(1.5rem, 4.5vw, 2.125rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.vf-hero p {
    color: var(--text-secondary);
    font-size: 0.975rem;
    line-height: 1.6;
    max-width: 60ch;
    margin: 0 0 0.875rem;
}

.vf-privacy {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(9, 180, 58, 0.1);
    border: 1px solid rgba(9, 180, 58, 0.28);
    color: var(--success-color);
    font-size: 0.8125rem;
    font-weight: 600;
}

.vf-privacy svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* ── Estructura de pasos ───────────────────────────────────────────── */
.vf-step {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--vf-radius);
    box-shadow: var(--shadow-card);
    padding: 1.125rem;
    margin-bottom: var(--vf-gap);
}

.vf-step-head {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.875rem;
}

.vf-step-num {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--accent-primary);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    font-family: var(--vf-mono);
}

.vf-step-head h2 {
    font-family: var(--vf-display);
    font-size: 1.0625rem;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin: 0;
}

.vf-step-head .vf-step-hint {
    margin-left: auto;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ── Zona de carga ─────────────────────────────────────────────────── */
.vf-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
    padding: 2rem 1rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--vf-radius);
    background: var(--bg-secondary);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--vf-speed) var(--vf-ease),
                background var(--vf-speed) var(--vf-ease),
                transform var(--vf-speed) var(--vf-ease);
}

.vf-drop:hover,
.vf-drop:focus-visible,
.vf-drop.is-dragover {
    border-color: var(--accent-primary);
    background: rgba(99, 91, 255, 0.06);
    outline: none;
}

.vf-drop.is-dragover {
    transform: scale(1.01);
}

.vf-drop svg {
    width: 34px;
    height: 34px;
    color: var(--accent-primary);
}

.vf-drop-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.975rem;
}

.vf-drop-sub {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.vf-file-meta {
    display: none;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin-top: 0.875rem;
    padding-top: 0.875rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.vf-file-meta.is-visible {
    display: flex;
}

.vf-file-meta dt {
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.15rem;
}

.vf-file-meta dd {
    margin: 0;
    font-family: var(--vf-mono);
    color: var(--text-primary);
    word-break: break-all;
}

/* ── Área de trabajo ───────────────────────────────────────────────── */
.vf-workspace[hidden] {
    display: none;
}

.vf-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--vf-gap);
}

.vf-stage {
    position: relative;
    background: #0b1220;
    border-radius: var(--vf-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    line-height: 0;
}

.vf-stage video {
    display: block;
    width: 100%;
    height: auto;
    background: #0b1220;
}

.vf-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: crosshair;
}

.vf-overlay.is-idle {
    cursor: default;
}

.vf-stage-hint {
    position: absolute;
    left: 50%;
    bottom: 0.75rem;
    transform: translateX(-50%);
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border-radius: 999px;
    background: rgba(10, 37, 64, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    font-size: 0.8125rem;
    line-height: 1.3;
    text-align: center;
    max-width: calc(100% - 1.5rem);
}

.vf-stage-hint.is-visible {
    display: flex;
}

/* Controles de reproducción propios */
.vf-transport {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0;
    flex-wrap: wrap;
}

.vf-time {
    font-family: var(--vf-mono);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.vf-seek {
    flex: 1 1 160px;
    min-width: 120px;
    accent-color: var(--accent-primary);
    height: 22px;
}

/* ── Panel lateral ─────────────────────────────────────────────────── */
.vf-panel {
    display: flex;
    flex-direction: column;
    gap: var(--vf-gap);
    min-width: 0;
}

.vf-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--vf-radius);
    box-shadow: var(--shadow-card);
    padding: 1rem;
}

.vf-card h3 {
    font-family: var(--vf-display);
    font-size: 0.95rem;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vf-card h3 .vf-count {
    font-family: var(--vf-mono);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 1px 7px;
}

/* ── Botones ───────────────────────────────────────────────────────── */
.vf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 44px;
    padding: 0.625rem 1rem;
    border-radius: var(--vf-radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--vf-speed) var(--vf-ease),
                border-color var(--vf-speed) var(--vf-ease),
                color var(--vf-speed) var(--vf-ease),
                transform var(--vf-speed) var(--vf-ease);
}

.vf-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.vf-btn:hover:not(:disabled) {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(99, 91, 255, 0.06);
}

.vf-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.vf-btn:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.vf-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.vf-btn--primary {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
    width: 100%;
}

.vf-btn--primary:hover:not(:disabled) {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

.vf-btn--danger:hover:not(:disabled) {
    border-color: var(--error-color);
    color: var(--error-color);
    background: rgba(223, 27, 65, 0.07);
}

.vf-btn--sm {
    min-height: 36px;
    padding: 0.4rem 0.7rem;
    font-size: 0.8125rem;
}

.vf-btn-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.vf-btn-row .vf-btn {
    flex: 1 1 auto;
}

/* ── Lista de zonas ────────────────────────────────────────────────── */
.vf-zones {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.vf-zone {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--zone-color, var(--accent-primary));
    border-radius: var(--vf-radius-sm);
    background: var(--bg-secondary);
    transition: border-color var(--vf-speed) var(--vf-ease);
}

.vf-zone:hover {
    border-color: var(--border-hover);
    border-left-color: var(--zone-color, var(--accent-primary));
}

.vf-zone-name {
    flex: 1;
    min-width: 0;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.3rem 0.4rem;
    min-height: 32px;
}

.vf-zone-name:hover {
    border-color: var(--border-color);
}

.vf-zone-name:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--input-bg);
}

.vf-zone-vertices {
    font-family: var(--vf-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.vf-icon-btn {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border: 1px solid transparent;
    border-radius: var(--vf-radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--vf-speed) var(--vf-ease);
}

.vf-icon-btn svg {
    width: 15px;
    height: 15px;
}

.vf-icon-btn:hover {
    color: var(--error-color);
    border-color: rgba(223, 27, 65, 0.35);
    background: rgba(223, 27, 65, 0.08);
}

.vf-icon-btn:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.vf-empty {
    padding: 0.875rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--vf-radius-sm);
    color: var(--text-muted);
    font-size: 0.8125rem;
    line-height: 1.5;
    text-align: center;
    margin-bottom: 0.75rem;
}

/* ── Ajustes ───────────────────────────────────────────────────────── */
.vf-field {
    margin-bottom: 0.875rem;
}

.vf-field:last-child {
    margin-bottom: 0;
}

.vf-field label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.vf-field-value {
    font-family: var(--vf-mono);
    font-size: 0.75rem;
    color: var(--accent-primary);
    font-variant-numeric: tabular-nums;
}

.vf-field input[type="range"] {
    width: 100%;
    accent-color: var(--accent-primary);
    height: 24px;
}

.vf-field-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.45;
    margin-top: 0.3rem;
}

.vf-check {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: var(--vf-radius-sm);
    background: var(--bg-secondary);
    cursor: pointer;
}

.vf-check input {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--accent-primary);
    flex-shrink: 0;
}

.vf-check-text {
    font-size: 0.8125rem;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.4;
}

.vf-check-text small {
    display: block;
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.2rem;
}

/* ── Progreso ──────────────────────────────────────────────────────── */
.vf-progress[hidden] {
    display: none;
}

.vf-progress {
    margin-top: 0.75rem;
}

.vf-progress-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.vf-progress-fill {
    height: 100%;
    width: 0;
    background: var(--accent-primary);
    border-radius: 999px;
    transition: width 160ms linear;
}

.vf-progress-label {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--vf-mono);
}

/* ── Resultados ────────────────────────────────────────────────────── */
.vf-results[hidden] {
    display: none;
}

.vf-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.625rem;
    margin-bottom: 1rem;
}

.vf-stat {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--vf-radius-sm);
    background: var(--bg-secondary);
}

.vf-stat dt {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.vf-stat dd {
    margin: 0;
    font-family: var(--vf-mono);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.vf-events {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.vf-event {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--zone-color, var(--accent-primary));
    border-radius: var(--vf-radius-sm);
    background: var(--bg-card);
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    transition: border-color var(--vf-speed) var(--vf-ease),
                background var(--vf-speed) var(--vf-ease),
                transform var(--vf-speed) var(--vf-ease);
}

.vf-event:hover {
    border-color: var(--border-hover);
    border-left-color: var(--zone-color, var(--accent-primary));
    background: var(--bg-secondary);
    transform: translateX(2px);
}

.vf-event:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.vf-event[aria-current="true"] {
    background: rgba(99, 91, 255, 0.07);
    border-color: var(--accent-primary);
    border-left-color: var(--zone-color, var(--accent-primary));
}

.vf-event-time {
    grid-row: span 2;
    align-self: center;
    font-family: var(--vf-mono);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-primary);
    font-variant-numeric: tabular-nums;
}

.vf-event-zone {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.vf-event-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--zone-color, var(--accent-primary));
    flex-shrink: 0;
}

.vf-event-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--vf-mono);
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.vf-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(99, 91, 255, 0.1);
    border: 1px solid rgba(99, 91, 255, 0.3);
    color: var(--accent-primary);
    font-size: 0.7rem;
    font-weight: 600;
    font-family: inherit;
}

/* ── Avisos ────────────────────────────────────────────────────────── */
.vf-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.75rem 0.875rem;
    border-radius: var(--vf-radius-sm);
    font-size: 0.8125rem;
    line-height: 1.5;
    margin-bottom: var(--vf-gap);
}

.vf-notice svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    margin-top: 1px;
}

.vf-notice--error {
    background: rgba(223, 27, 65, 0.08);
    border: 1px solid rgba(223, 27, 65, 0.3);
    color: var(--error-color);
}

.vf-notice--warn {
    background: rgba(233, 165, 0, 0.09);
    border: 1px solid rgba(233, 165, 0, 0.32);
    color: var(--warning-color);
}

.vf-notice[hidden] {
    display: none;
}

.vf-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Metodología ───────────────────────────────────────────────────── */
.vf-method {
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.65;
}

.vf-method h2 {
    font-family: var(--vf-display);
    font-size: 1.0625rem;
    color: var(--text-primary);
    margin: 0 0 0.625rem;
}

.vf-method ol {
    margin: 0;
    padding-left: 1.25rem;
}

.vf-method li {
    margin-bottom: 0.4rem;
}

.vf-method code {
    font-family: var(--vf-mono);
    font-size: 0.8125rem;
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1px 5px;
}

/* ── Escritorio ────────────────────────────────────────────────────── */
@media (min-width: 900px) {
    .vf {
        padding: 2rem 1.5rem 4rem;
    }

    .vf-layout {
        grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr);
        align-items: start;
    }

    .vf-step {
        padding: 1.5rem;
    }

    .vf-drop {
        padding: 2.5rem 2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vf-drop,
    .vf-btn,
    .vf-event,
    .vf-progress-fill {
        transition: none;
    }
}
