/* ============================================================
   ARCHIVO: static/css/traduccion/traductor.css
   DISEÑO:  Intérprete de Señas — Signia (azul y blanco)
   ============================================================ */

/* ── 1. VARIABLES ─────────────────────────────────────────── */
:root {
  --blue:        #2563eb;
  --blue-mid:    #3b82f6;
  --blue-light:  #60a5fa;
  --blue-pale:   #dbeafe;
  --blue-bg:     #eff6ff;
  --white:       #ffffff;
  --bg:          #f0f6ff;
  --text-dark:   #1e3a5f;
  --text-mid:    #4b6a9b;
  --text-light:  #93afd4;
  --border:      #c8daf5;

  --azul:        #2563eb;
  --azul-suave:  #eff6ff;
  --azul-borde:  #bfdbfe;
  --gris-suave:  #f8fafc;
  --texto:       #1e3a5f;
}

/* ── 2. BASE ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  font-family: 'Nunito', 'DM Sans', sans-serif;
  color: var(--text-dark);
  min-height: 100dvh;
}

/* ── 3. CONTENEDOR PRINCIPAL ─────────────────────────────── */
.con {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin: 24px auto 48px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 0;
    width: 100%;
    max-width: 1024px; /* Aumentado de 840px para que el contenedor principal sea más grande */
    height: auto;      /* Permitir altura dinámica para alojar un video más grande */
    min-height: calc(100dvh - 120px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* ── 4. HEADER AZUL ──────────────────────────────────────── */
.gap {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    width: 100%;
    padding: 24px 28px 22px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.gap-icon svg{
    background: rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    padding: 10px;
    width: 60px;
    height: 60px;
}
.gap-icon {
    display: flex;
    color: #ffffff;
    margin-bottom: 2px;
    gap: 10px;
}

.titulo-seccion {
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.3px;
    text-transform: none;
    margin: 0;
}

.gap-subtitulo {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.88);
    margin: 0;
    font-weight: 400;
    line-height: 1.4;
}

/* ── 5. CONTENIDO INTERIOR ───────────────────────────────── */
.inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 24px 28px 28px;
    flex: 1;
    overflow: hidden;
}

/* ── 6. LABEL ────────────────────────────────────────────── */
label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--azul);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

/* ── 7. INPUT CON LUPA ────────────────────────────────────── */
.input-group {
    display: flex;
    width: 100%;
    align-items: stretch;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    background: var(--gris-suave);
    transition: border-color 0.2s, box-shadow 0.2s;
    overflow: hidden;
    min-height: 60px;
    flex-shrink: 0;
}

.input-group:focus-within {
    border-color: var(--azul);
    box-shadow: 0 0 0 3px var(--azul-suave);
    background: #fff;
}

.input-group input[type="text"] {
  flex: 1;
  border: none;
  outline: none;
  height: 60px; /* Altura fija coherente con el grupo */
  padding: 0 1.5rem;
  font-size: 16px; /* Para evitar zoom en iOS */
  color: var(--text-dark);
  background: transparent;
  font-family: inherit;
}

.input-group input[type="text"]::placeholder {
    color: #9ca3af;
}

.btn-lupa {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--azul);
    border: none;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-lupa:hover {
    background: #1d4ed8;
}

/* ── 8. CONTENEDOR DE VIDEO ───────────────────────────────── */
.video {
    width: 100%;
    aspect-ratio: 16 / 9; /* Relación de aspecto ideal para video */
    min-height: 380px;    /* Aumentado significativamente para que sea más grande */
    max-height: 520px;
    border-radius: 12px;
    background: var(--gris-suave);
    border: 1.5px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.video video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.video-placeholder {
    color: #9ca3af;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ── 9. BOTÓN MICRÓFONO ───────────────────────────────────── */
.btn-mic {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 42px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    background: var(--azul-suave);
    border: 1.5px solid var(--azul-borde);
    color: var(--azul);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-mic:hover {
    background: #dbeafe;
    border-color: var(--azul);
}

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

/* ── 10. NOTIFICACIÓN FLOTANTE ────────────────────────────── */
#notificacionNoEncontrado {
    display: none;
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ff4d4f;
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-15px);
    }
}

/* Estilos LSC */

/* Aviso fallback */
.lsc-aviso {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #92400e;
    margin-bottom: 14px;
}

/* Panel LSC principal — toast flotante inferior derecha */
.lsc-panel {
    position: fixed !important;
    bottom: 28px !important;
    right: 28px !important;
    top: auto !important;
    left: auto !important;
    width: 320px;
    max-width: calc(100vw - 40px);
    border: 1px solid #d1fae5;
    border-radius: 14px;
    padding: 16px 18px 20px;
    background: #f0fdf4;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
    z-index: 99999 !important;
    animation: toastIn 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
    overflow: hidden;
    /* Reset any inherited flex/grid behavior */
    display: block !important;
    margin: 0 !important;
    flex: none !important;
}

.lsc-panel.lsc-panel--hiding {
    animation: toastOut 0.3s ease-in forwards;
}

/* Barra de progreso auto-dismiss */
.lsc-panel__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 14px 14px;
    background: #22c55e;
    animation: progressBar var(--lsc-duration, 7s) linear forwards;
}

/* Botón cerrar */
.lsc-panel__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 22px;
    height: 22px;
    border: none;
    background: rgba(0,0,0,0.06);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 14px;
    line-height: 1;
    transition: background 0.2s;
}
.lsc-panel__close:hover { background: rgba(0,0,0,0.14); }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(12px) scale(0.96); }
}

@keyframes progressBar {
    from { width: 100%; }
    to   { width: 0%; }
}

/* Badges meta */
.lsc-panel__meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.lsc-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.lsc-badge--declarative  { background: #dbeafe; color: #1e40af; }
.lsc-badge--negative     { background: #fee2e2; color: #991b1b; }
.lsc-badge--question_yn  { background: #fef9c3; color: #854d0e; }
.lsc-badge--question_wh  { background: #ede9fe; color: #4c1d95; }
.lsc-badge--exclamative  { background: #fce7f3; color: #9d174d; }
.lsc-badge--facial       { background: #fce7f3; color: #9d174d; }

/* Fila de tokens */
.lsc-tokens {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px 4px;
}

.lsc-token-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
}

/* Flecha entre tokens */
.lsc-arrow {
    position: absolute;
    right: -10px;
    top: 10px;
    font-size: 16px;
    color: #86efac;
    pointer-events: none;
    line-height: 1;
}

.lsc-token {
    display: inline-block;
    padding: 6px 13px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.03em;
    background: #fff;
    border: 1.5px solid #86efac;
    color: #166534;
    white-space: nowrap;
}

.lsc-token--missing {
    background: #fff1f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.lsc-token--synonym {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #92400e;
}

/* Etiqueta bajo el token */
.lsc-token__label {
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
}
.lsc-token__label--spell  { color: #b91c1c; }
.lsc-token__label--record { color: #b45309; }
.lsc-token__label--syn    { color: #92400e; }

/* Nota lingüística */
.lsc-panel__note {
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
    margin-top: 10px;
    margin-bottom: 0;
}

/* Faltantes */
.lsc-faltantes {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #d1fae5;
}

.lsc-faltantes__titulo {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: 100%;
}

.lsc-faltante-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.lsc-faltante-chip--spell  { background: #fee2e2; color: #991b1b; }
.lsc-faltante-chip--record { background: #fff7ed; color: #92400e; }

.lsc-faltante-chip__est {
    font-weight: 400;
    font-size: 10px;
    opacity: 0.8;
}

/* ── 11. LSC RESULTADO STRIP (panel permanente) ────────── */
.lsc-resultado {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f0fdf4;
    border: 1px solid #d1fae5;
    border-radius: 10px;
    min-height: 40px;
    overflow-x: auto;
    flex-shrink: 0;
    scrollbar-width: thin;
    scrollbar-color: #86efac transparent;
}

.lsc-resultado--hint {
    background: #f8fafc;
    border-color: #e5e7eb;
}

.lsc-res__label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #22c55e;
    flex-shrink: 0;
    background: #dcfce7;
    padding: 2px 7px;
    border-radius: 6px;
}

.lsc-res__chips {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
}

.lsc-res__hint {
    font-size: 12px;
    color: #9ca3af;
    font-style: italic;
}

.lsc-chip {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.lsc-chip--miss {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.lsc-chip--syn {
    background: #fef9c3;
    color: #854d0e;
    border-color: #fcd34d;
}

.lsc-chip-sep {
    color: #86efac;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
    user-select: none;
}

/* ── 12. RESPONSIVO ──────────────────────────────── */
@media (max-width: 768px) {
    .con {
        margin: 8px auto;
        height: auto;
        min-height: calc(100dvh - 80px);
        border-radius: 12px;
    }
    
    .gap {
        padding: 16px 20px;
    }
    
    .titulo-seccion {
        font-size: 1.2rem;
    }

    .video {
        min-height: 180px;
        aspect-ratio: 4 / 3;
        height: auto;
    }

    .lsc-resultado {
        min-height: 36px;
        padding: 6px 10px;
    }

    .lsc-panel {
        width: calc(100% - 24px);
        right: 12px !important;
        bottom: 12px !important;
    }

    /* Evitar zoom en iOS al hacer foco en input */
    .input-group input[type="text"] {
        font-size: 16px;
    }

    .btn-mic,
    .btn-lupa {
        touch-action: manipulation;
    }
}

@media (max-width: 480px) {
    #notificacionNoEncontrado {
        top: 70px; 
        width: 90%;
        padding: 10px 16px;
        font-size: 0.88rem;
        justify-content: center;
    }
    
    .inner {
        padding: 16px 14px;
        gap: 10px;
    }

    .gap-icon svg {
        width: 46px;
        height: 46px;
    }

    .gap {
        padding: 14px 16px;
    }
}