/* ============================================================
   Simulación · Pila Daniell — estilos propios de esta vista.
   (El header/footer/tema general vive en assets/css/main.css)
   Sin var() por el mismo motivo que main.css: compatibilidad
   con el validador CSS de NetBeans 8.2.
   ============================================================ */

/* ── LAYOUT ─────────────────────────────────────────────── */
.pila-layout {
    display: grid;
    grid-template-columns: 290px 1fr;
    gap: 0;
    min-height: 70vh;
}
.pila-sidebar {
    background: #ffffff;
    border-right: 1px solid rgba(15, 23, 42, 0.10);
    padding: 20px 16px;
    overflow-y: auto;
}
.pila-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
.sidebar-section { margin-bottom: 20px; }
.sidebar-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #5b6472;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.10);
}
.electrode-card {
    background: #f5f7fb;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
.electrode-card .ec-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.badge-anode {
    background: rgba(59, 139, 212, 0.15);
    color: #2b6cb0;
    border: 1px solid rgba(59, 139, 212, 0.3);
    border-radius: 4px;
    padding: 1px 7px;
    font-size: 0.65rem;
}
.badge-cathode {
    background: rgba(200, 104, 48, 0.15);
    color: #a8551f;
    border: 1px solid rgba(200, 104, 48, 0.3);
    border-radius: 4px;
    padding: 1px 7px;
    font-size: 0.65rem;
}
.electrode-card select {
    width: 100%;
    background: #eef2f7;
    color: #1b2433;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 0.82rem;
    font-family: 'Source Sans 3', sans-serif;
    cursor: pointer;
    outline: none;
    transition: border-color .2s;
}
.electrode-card select:focus { border-color: #e8a020; }
.electrode-card select option { background: #ffffff; }

.e0-display {
    margin-top: 7px;
    font-size: 0.75rem;
    color: #5b6472;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.e0-val {
    font-family: 'Fira Mono', monospace;
    font-size: 0.82rem;
    font-weight: 500;
}

/* ── POTENTIALS PANEL ────────────────────────────────────── */
.pot-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 6px;
}
.pot-card {
    background: #f5f7fb;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 10px;
    padding: 11px 10px;
    text-align: center;
}
.pot-card .pv {
    font-family: 'Fira Mono', monospace;
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.2;
}
.pot-card .pl {
    font-size: 0.63rem;
    color: #5b6472;
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.pv-anode { color: #2b6cb0; }
.pv-cathode { color: #a8551f; }
.pv-cell { color: #2f9160; }
.pv-deltag { color: #a8710f; }
.pv-neg { color: #c23636; }

.pot-grid-secondary {
    grid-template-columns: 1fr 1fr;
    margin-top: 8px;
}

/* ── POTENTIALS EQUATION (ánodo − cátodo = celda, con números reales) ── */
.pot-equation {
    background: #f5f7fb;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 6px;
}
.pot-eq-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}
.pot-eq-row .pv {
    font-family: 'Fira Mono', monospace;
    font-size: 0.95rem;
    font-weight: 500;
}
.pot-eq-label {
    font-size: 0.75rem;
    color: #5b6472;
}
.pot-eq-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px dashed rgba(15, 23, 42, 0.18);
}
.pot-eq-result .pv { font-size: 1.05rem; }
.pot-eq-formula-label {
    font-size: 0.68rem;
    color: #5b6472;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.pot-note {
    font-size: 0.68rem;
    color: #5b6472;
    font-style: italic;
    margin: 8px 2px 6px;
    line-height: 1.4;
}

/* ── CONCENTRATIONS (Nernst) ─────────────────────────────── */
.conc-row {
    display: grid;
    grid-template-columns: 46px 1fr 62px;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.75rem;
    color: #5b6472;
}
.conc-row label {
    font-family: 'Fira Mono', monospace;
    font-size: 0.78rem;
    color: #1b2433;
}
.conc-row input[type="range"] {
    width: 100%;
    accent-color: #e8a020;
}
.conc-val {
    font-family: 'Fira Mono', monospace;
    font-size: 0.7rem;
    text-align: right;
}

/* ── FARADAY (avanzado, opt-in) ───────────────────────────── */
.faraday-check-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.72rem;
    color: #5b6472;
    margin-bottom: 10px;
    cursor: pointer;
}
.faraday-check-label input { accent-color: #e8a020; cursor: pointer; }

.faraday-intro {
    font-size: 0.73rem;
    line-height: 1.45;
    color: #5b6472;
    margin: 0 0 10px;
}
.faraday-input-row {
    display: grid;
    grid-template-columns: 1fr 80px;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.faraday-input-row label {
    font-size: 0.73rem;
    color: #1b2433;
}
.faraday-input-row input[type="number"] {
    width: 100%;
    background: #eef2f7;
    color: #1b2433;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 6px;
    padding: 5px 8px;
    font-family: 'Fira Mono', monospace;
    font-size: 0.78rem;
    text-align: right;
}
.faraday-results {
    background: #f5f7fb;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 10px;
    padding: 10px 14px;
    margin-top: 10px;
}
.faraday-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 0.72rem;
    color: #5b6472;
    border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}
.faraday-result-row:last-child { border-bottom: none; }
.faraday-result-row span:last-child {
    font-family: 'Fira Mono', monospace;
    font-size: 0.78rem;
    color: #1b2433;
    font-weight: 500;
}
.faraday-result-highlight span:last-child { color: #a8710f; font-weight: 600; }

/* spontaneity banner */
.spont-banner {
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: .03em;
    text-align: center;
    margin-top: 6px;
}
.spont-yes { background: rgba(76,175,130,0.12); border: 1px solid rgba(76,175,130,0.3); color: #2f9160; }
.spont-no  { background: rgba(224,80,80,0.12);  border: 1px solid rgba(224,80,80,0.3);  color: #c23636; }

/* ── REACTIONS ───────────────────────────────────────────── */
.rx-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.rx-card {
    background: #f5f7fb;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 10px;
    padding: 11px 14px;
}
.rx-type {
    font-size: 0.63rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 5px;
}
.rx-type-ox { color: #2b6cb0; }
.rx-type-red { color: #a8551f; }
.rx-eq {
    font-family: 'Fira Mono', monospace;
    font-size: 0.82rem;
    color: #1b2433;
    line-height: 1.5;
}

/* ── CANVAS AREA ─────────────────────────────────────────── */
.canvas-wrapper {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 14px;
    padding: 12px;
    flex: 1;
}
.pila-canvas-inner {
    position: relative;
}
.pila-canvas-inner canvas {
    display: block;
    width: 100%;
    border-radius: 8px;
}

/* ── ICONOS "i" SOBRE EL CANVAS ───────────────────────────── */
.pila-canvas-info-btn {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e8a020;
    color: #1b2433;
    border: none;
    font-size: 0.7rem;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 5;
}
.pila-canvas-info-btn:hover { background: #ffb230; }

.canvas-info-popover {
    position: absolute;
    width: 200px;
    background: #fbfaf7;
    color: #26303d;
    border-radius: 10px;
    padding: 10px 20px 10px 12px;
    border-left: 4px solid #e8a020;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.28);
    z-index: 10;
}
.canvas-info-popover[hidden] { display: none; }
.canvas-info-popover .pila-info-close {
    position: absolute;
    top: 2px;
    right: 4px;
    background: none;
    border: none;
    font-size: 0.95rem;
    color: #5b6472;
    cursor: pointer;
    padding: 2px 6px;
}
.canvas-info-popover .pila-info-bubble-title {
    font-size: 0.76rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: #1c2330;
}
.canvas-info-popover .pila-info-bubble-text {
    font-size: 0.71rem;
    line-height: 1.4;
    color: #3a4452;
}
.canvas-info-popover-bridge { border-left-color: #9f7fd4; }
.canvas-info-popover-electrons { border-left-color: #EF9F27; }
.canvas-info-popover-liquid { border-left-color: #4fa8f0; }

/* ── PLAYBACK CONTROLS ───────────────────────────────────── */
.pila-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
    padding: 0 4px;
}
.pila-btn-pause {
    background: #f5f7fb;
    color: #a8710f;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 8px;
    width: 34px;
    height: 34px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color .2s;
}
.pila-btn-pause:hover { border-color: #e8a020; }
.pila-speed-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.73rem;
    color: #5b6472;
}
.pila-speed-control input[type="range"] {
    width: 110px;
    accent-color: #e8a020;
}
.pila-speed-control #speed-val {
    font-family: 'Fira Mono', monospace;
    color: #1b2433;
    min-width: 40px;
}

/* legend */
.legend {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding: 0 4px;
}
.leg-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.73rem;
    color: #5b6472;
}
.leg-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── INFO EXPANDIBLE (explicación para el alumno) ────────── */
/* Insignia "i" dibujada por CSS: el carácter ⓘ no se renderiza igual en
   todas las fuentes del sistema, así que se evita por fiabilidad. */
.pila-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e8a020;
    color: #1b2433;
    font-size: 0.68rem;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
    flex-shrink: 0;
}

.pila-info-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: rgba(232, 160, 32, 0.12);
    border: none;
    border-bottom: 1px solid rgba(232, 160, 32, 0.35);
    color: #a8710f;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Source Sans 3', sans-serif;
    padding: 10px 20px;
    cursor: pointer;
    text-align: left;
}
.pila-info-trigger:hover { background: rgba(232, 160, 32, 0.20); }
.pila-info-chevron {
    margin-left: auto;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #e8a020;
    transition: transform .2s;
    flex-shrink: 0;
}
.pila-info-trigger[aria-expanded="true"] .pila-info-chevron { transform: rotate(180deg); }

.pila-info-icon-btn {
    background: none;
    border: none;
    padding: 2px;
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.pila-info-panel {
    background: #fbfaf7;
    color: #26303d;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.pila-info-intro {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #3a4452;
    margin: 0 0 10px;
}

.pila-info-inline {
    background: #fbfaf7;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
}

.pila-info-bubble {
    background: #f0eee7;
    border-left: 4px solid #e8a020;
    border-radius: 8px;
    padding: 9px 12px;
    margin-bottom: 8px;
}
.pila-info-bubble:last-child { margin-bottom: 0; }
.pila-info-bubble-title {
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 3px;
    color: #1c2330;
}
.pila-info-bubble-text {
    font-size: 0.78rem;
    line-height: 1.5;
    color: #3a4452;
}
.pila-info-bubble-anode { border-left-color: #3b8bd4; }
.pila-info-bubble-cathode { border-left-color: #c86830; }
.pila-info-bubble-bridge { border-left-color: #9f7fd4; }
.pila-info-bubble-liquid { border-left-color: #4fa8f0; }
.pila-info-bubble-electrons { border-left-color: #EF9F27; }
.pila-info-bubble-challenge { border-left-color: #4caf82; background: #eef6f1; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
    .pila-layout { grid-template-columns: 1fr; }
    .pila-sidebar { border-right: none; border-bottom: 1px solid rgba(15, 23, 42, 0.10); }
}
