/******************************************************************************
 *
 * File...........: didactic.css
 * Project........: EnigmaJS
 * Description....: Estilos del Panel Didáctico (E0033)
 *
 ******************************************************************************/

/* ============================================================
   PANEL PRINCIPAL
   ============================================================ */

#didacticPanel {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    padding: 0 0 40px 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

#didacticPanel.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* ============================================================
   CABECERA DEL PANEL
   ============================================================ */

.didactic-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 2px solid #2d2a27;
}

.didactic-title-area {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.didactic-title {
    font-family: var(--font-title);
    font-size: 24px;
    font-weight: 700;
    color: var(--color-title);
    letter-spacing: 1px;
}

.didactic-subtitle {
    font-size: 13px;
    color: var(--color-text-dim);
}

.didactic-key-display {
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: var(--font-title);
    font-size: 32px;
    font-weight: 700;
}

.didactic-key-input {
    color: #f0d080;
    background: rgba(240, 208, 128, 0.08);
    border: 2px solid rgba(240, 208, 128, 0.3);
    border-radius: 10px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 0 14px rgba(240, 208, 128, 0.1);
}

.didactic-key-arrow {
    color: var(--color-text-dim);
    font-size: 20px;
}

.didactic-key-output {
    color: #80d8ff;
    background: rgba(128, 216, 255, 0.08);
    border: 2px solid rgba(128, 216, 255, 0.3);
    border-radius: 10px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 0 14px rgba(128, 216, 255, 0.1);
}

.didactic-key-placeholder {
    color: var(--color-text-dim);
    font-size: 16px;
    font-style: italic;
    font-weight: 400;
}

.didactic-close-btn {
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 600;
    padding: 8px 16px;
    border: 1px solid #3d3a36;
    border-radius: 6px;
    background: #252321;
    color: var(--color-text-dim);
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.didactic-close-btn:hover {
    border-color: var(--color-accent);
    color: #ff6b6b;
}

/* ============================================================
   SECCIÓN: DIAGRAMA DE FLUJO
   ============================================================ */

.didactic-section {
    background: linear-gradient(135deg, #1e1b18 0%, #1a1714 100%);
    border: 1px solid #2d2a26;
    border-radius: 14px;
    padding: 24px;
}

.didactic-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-title);
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid #2d2a27;
    display: flex;
    align-items: center;
    gap: 8px;
}

.didactic-section-title::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-gold);
}

/* Contenedor del diagrama de flujo */
.flow-diagram {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.flow-row {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: min-content;
}

.flow-row-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-dim);
    width: 60px;
    flex-shrink: 0;
    text-align: right;
    padding-right: 10px;
}

/* Bloques de componente */
.flow-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 10px;
    padding: 10px 14px;
    min-width: 72px;
    border: 1px solid transparent;
    opacity: 0.35;
    transition: opacity 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.flow-block.active-forward {
    opacity: 1;
    border-color: rgba(240, 208, 128, 0.5);
    box-shadow: 0 0 16px rgba(240, 208, 128, 0.15);
    background: rgba(240, 208, 128, 0.06);
}

.flow-block.active-backward {
    opacity: 1;
    border-color: rgba(128, 216, 255, 0.5);
    box-shadow: 0 0 16px rgba(128, 216, 255, 0.15);
    background: rgba(128, 216, 255, 0.06);
}

.flow-block.active-reflect {
    opacity: 1;
    border-color: rgba(180, 120, 255, 0.6);
    box-shadow: 0 0 20px rgba(180, 120, 255, 0.25);
    background: rgba(180, 120, 255, 0.08);
}

.flow-block-name {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-dim);
    margin-bottom: 6px;
    text-align: center;
}

.flow-block-letter {
    font-family: var(--font-title);
    font-size: 22px;
    font-weight: 700;
    min-height: 28px;
    text-align: center;
}

.active-forward  .flow-block-letter { color: #f0d080; }
.active-backward .flow-block-letter { color: #80d8ff; }
.active-reflect  .flow-block-letter { color: #c084fc; }

/* Flechas entre bloques */
.flow-arrow {
    color: var(--color-text-dim);
    font-size: 16px;
    opacity: 0.4;
    flex-shrink: 0;
    transition: opacity 0.3s;
}

.flow-arrow.active-fwd { opacity: 1; color: rgba(240, 208, 128, 0.7); }
.flow-arrow.active-bck { opacity: 1; color: rgba(128, 216, 255, 0.7); }

/* Separador de reflector */
.flow-reflect-divider {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4px 0;
    gap: 4px;
}

.flow-reflect-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(180, 120, 255, 0.7);
    text-align: center;
    padding: 0 16px;
}

/* ============================================================
   SECCIÓN: INSPECTOR DE ESTADO
   ============================================================ */

.state-inspector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.state-card {
    background: #18160f;
    border: 1px solid #2d2a26;
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color 0.3s;
}

.state-card.stepped {
    border-color: rgba(240, 208, 128, 0.5);
    background: rgba(240, 208, 128, 0.04);
}

.state-card-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--color-text-dim);
}

.state-card-rotor-name {
    font-family: var(--font-title);
    font-size: 18px;
    font-weight: 700;
    color: var(--color-title);
}

.state-card-detail {
    font-size: 12px;
    color: var(--color-text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
}

.state-card-detail strong {
    color: var(--color-text);
    font-weight: 600;
}

.state-stepped-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #f0d080;
    background: rgba(240, 208, 128, 0.12);
    border: 1px solid rgba(240, 208, 128, 0.3);
    border-radius: 4px;
    padding: 2px 6px;
    margin-top: 4px;
}

/* ============================================================
   SECCIÓN: EXPLICACIÓN PASO A PASO
   ============================================================ */

.explanation-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.explanation-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    background: #18160f;
    border: 1px solid #2d2a26;
    font-size: 13px;
    line-height: 1.6;
    color: var(--color-text);
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.explanation-step.visible {
    opacity: 1;
    transform: translateX(0);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

.step-number.forward {
    background: rgba(240, 208, 128, 0.12);
    color: #f0d080;
    border: 1px solid rgba(240, 208, 128, 0.3);
}

.step-number.reflect {
    background: rgba(180, 120, 255, 0.12);
    color: #c084fc;
    border: 1px solid rgba(180, 120, 255, 0.3);
}

.step-number.backward {
    background: rgba(128, 216, 255, 0.12);
    color: #80d8ff;
    border: 1px solid rgba(128, 216, 255, 0.3);
}

.step-text em {
    font-style: normal;
    font-weight: 700;
    color: #f0d080;
}

.step-text em.blue { color: #80d8ff; }
.step-text em.purple { color: #c084fc; }

/* ============================================================
   LEYENDA DE COLORES
   ============================================================ */

.didactic-legend {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: #18160f;
    border-radius: 8px;
    border: 1px solid #2d2a26;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--color-text-dim);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-dot.forward  { background: #f0d080; box-shadow: 0 0 6px rgba(240,208,128,0.5); }
.legend-dot.reflect  { background: #c084fc; box-shadow: 0 0 6px rgba(180,120,255,0.5); }
.legend-dot.backward { background: #80d8ff; box-shadow: 0 0 6px rgba(128,216,255,0.5); }
