/* ==========================================================================
   POKÉDEX FRAME — Componente CSS reutilizable
   Uso: include inc/ui/pokedex_frame.php y cargar este CSS en el <head>.
   Ver documentación completa en CLAUDE.md § Pokédex Frame Component.
   ========================================================================== */

/* ── Wrapper exterior (cuerpo rojo) ─────────────────────────────────────── */
.pokedex-wrapper {
    position: relative;
    max-width: 1400px;
    margin: 0 auto 32px;
    background: var(--poke-red);
    border-radius: 28px 28px 20px 20px;
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,0.18),
        inset 0 -3px 0 rgba(0,0,0,0.25),
        0 12px 40px rgba(0,0,0,0.6),
        0 4px 8px rgba(0,0,0,0.4);
    overflow: visible; /* CRÍTICO: no clippear el autocomplete/dropdowns */
}

/* Modificador ancho reducido (para juegos como Wordle que son más estrechos) */
.pokedex-wrapper--sm { max-width: 720px; }
.pokedex-wrapper--md { max-width: 980px; }

/* ── Barra superior ──────────────────────────────────────────────────────── */
.pokedex-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px 12px;
    background: var(--poke-red);
    border-radius: 28px 28px 0 0;
    border-bottom: 3px solid rgba(0,0,0,0.2);
}

/* Cámara */
.pokedex-camera {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}
.pokedex-camera-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.25), inset 0 2px 4px rgba(0,0,0,0.3);
}
.pokedex-camera-lens {
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    z-index: 1;
    background: radial-gradient(circle at 35% 30%, #5ba3e8 0%, var(--poke-blue) 45%, #1a4a8a 100%);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.4), 0 0 0 2px rgba(255,255,255,0.3);
}
.pokedex-camera-lens::after {
    content: '';
    position: absolute;
    top: 18%; left: 20%;
    width: 28%; height: 28%;
    border-radius: 50%;
    background: rgba(255,255,255,0.55);
}

/* Status dots */
.pokedex-status-dots { display: flex; gap: 8px; align-items: center; }
.pdx-dot {
    display: block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.25);
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.4), 0 1px 2px rgba(0,0,0,0.3);
}
.dot-red    { background: #ff4444; }
.dot-yellow { background: var(--poke-yellow); }
.dot-green  { background: #44dd44; }

/* Vents superiores */
.pokedex-vents--top {
    margin-left: auto;
    display: flex;
    gap: 5px;
    align-items: center;
    height: 30px;
}
.pokedex-vents--top span {
    display: block;
    width: 4px;
    height: 100%;
    background: rgba(0,0,0,0.22);
    border-radius: 2px;
}

/* ── Fila central ────────────────────────────────────────────────────────── */
.pokedex-body {
    display: flex;
    align-items: stretch;
    background: var(--poke-red);
}

/* Paneles laterales (compartido) */
.pokedex-side {
    flex-shrink: 0;
    width: 72px;
    background: var(--poke-red);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 8px;
    box-shadow: inset 0 0 12px rgba(0,0,0,0.15);
}

/* Panel izquierdo: flecha amarilla + círculo rojo */
.pdx-arrow-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--poke-yellow);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.4);
    border: 2px solid rgba(0,0,0,0.2);
}
.pdx-arrow-triangle {
    display: block;
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 12px solid rgba(0,0,0,0.6);
    margin-left: 3px;
}
.pdx-play-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(145deg, #cc0000, #990000);
    border: 2px solid rgba(0,0,0,0.3);
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

/* Panel derecho: vents horizontales */
.pdx-vent-lines { display: flex; flex-direction: column; gap: 6px; width: 44px; }
.pdx-vent-lines span {
    display: block;
    height: 5px;
    background: rgba(0,0,0,0.2);
    border-radius: 3px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

/* ── Bezel navy + pantalla crema ─────────────────────────────────────────── */
/* overflow:visible en ambos — CRÍTICO para que dropdowns/autocomplete escapen */
.pokedex-screen-bezel {
    flex: 1;
    min-width: 0;
    background: var(--poke-navy);
    border-radius: 12px;
    margin: 10px 0;
    padding: 10px;
    box-shadow:
        inset 0 3px 8px rgba(0,0,0,0.6),
        inset 0 -2px 4px rgba(0,0,0,0.3),
        0 0 0 2px rgba(0,0,0,0.3);
    overflow: visible;
    position: relative;
    z-index: 0;
}
.pokedex-screen {
    background: #f5f0e8;
    border-radius: 8px;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.25), inset 0 -1px 3px rgba(0,0,0,0.1);
    overflow: visible;
    position: relative;
}
/* Scanline cosmético (no afecta al contenido) */
.pokedex-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    pointer-events: none;
    z-index: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent, transparent 3px,
        rgba(0,0,0,0.025) 3px, rgba(0,0,0,0.025) 4px
    );
}

/* ── Barra inferior ──────────────────────────────────────────────────────── */
.pokedex-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px 16px;
    background: var(--poke-red);
    border-radius: 0 0 20px 20px;
    border-top: 3px solid rgba(0,0,0,0.2);
}
.pokedex-oval-btn {
    width: 80px;
    height: 32px;
    border-radius: 50%;
    background: var(--poke-yellow);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 6px rgba(0,0,0,0.4), inset 0 2px 0 rgba(255,255,255,0.4);
    border: 2px solid rgba(0,0,0,0.2);
}
.pokedex-oval-btn-inner {
    width: 60px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.3), transparent);
    border-top: 1px solid rgba(255,255,255,0.5);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .pokedex-wrapper      { max-width: 100%; border-radius: 20px 20px 14px 14px; }
    .pokedex-side         { width: 48px; padding: 12px 4px; }
    .pdx-arrow-btn        { width: 28px; height: 28px; }
    .pdx-arrow-triangle   { border-top-width: 5px; border-bottom-width: 5px; border-left-width: 9px; }
    .pdx-play-btn         { width: 22px; height: 22px; }
    .pokedex-camera       { width: 40px; height: 40px; }
    .pdx-dot              { width: 10px; height: 10px; }
    .pokedex-screen-bezel { margin: 8px 0; padding: 7px; }
}

@media (max-width: 600px) {
    /* El marco se mantiene visible en móvil (igual que en tablet), solo se
       encoge más — nunca desaparece del todo. */
    .pokedex-wrapper      { border-radius: 16px 16px 10px 10px; margin: 0 0 16px; }
    .pokedex-header       { padding: 10px 12px 8px; gap: 8px; }
    .pokedex-footer       { padding: 10px 12px 12px; }
    .pokedex-side         { width: 28px; padding: 8px 2px; gap: 8px; }
    .pdx-arrow-btn        { width: 22px; height: 22px; }
    .pdx-arrow-triangle   { border-top-width: 4px; border-bottom-width: 4px; border-left-width: 7px; }
    .pdx-play-btn         { width: 16px; height: 16px; }
    .pokedex-camera       { width: 30px; height: 30px; }
    .pdx-dot              { width: 8px; height: 8px; }
    .pokedex-vents--top,
    .pdx-vent-lines       { display: none; } /* puramente decorativo, primero en caer */
    .pokedex-screen-bezel { margin: 6px 0; padding: 5px; }
}
