/* ============================================
   BASICAIO - Estilo visual amigable escolar
   ============================================ */

:root {
  --app-bg: #F7F8FA;
  --panel-bg: #FFFFFF;
  --panel-soft: #EEF2F7;
  --text-main: #1E293B;
  --text-muted: #64748B;
  --border-soft: #CBD5E1;
  --border-light: #E2E8F0;

  --blue-main: #4D96FF;
  --blue-soft: #EEF6FF;
  --green-main: #22C55E;
  --green-soft: #DCFCE7;
  --red-main: #EF4444;
  --red-soft: #FEE2E2;

  --console-bg: #102A43;
  --console-text: #A7F3D0;
  --console-border: #1E3A5F;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--app-bg);
  color: var(--text-main);
  font-family: "Segoe UI", Arial, sans-serif;
}

#container {
  display: flex;
  height: 100vh;
  gap: 10px;
  padding: 10px;
}

#left-panel {
  width: 35%;
  min-width: 420px;
  background: var(--panel-bg);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  padding: 14px;
  overflow: hidden;
}

#left-panel h2 {
  margin: 4px 0 18px 0;
  font-size: 26px;
  color: var(--text-main);
  letter-spacing: 0.2px;
}

#right-panel {
  flex-grow: 1;
  background: var(--panel-soft);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
  overflow: hidden;
}

#blocklyDiv {
  height: 100%;
  width: 100%;
  background: var(--panel-soft);
}

/* Fila superior */
#info-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

button {
  background: #FFFFFF;
  color: var(--text-main);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 7px 12px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}

button:hover {
  background: var(--blue-soft);
  border-color: var(--blue-main);
}

button:active {
  transform: translateY(1px);
}

/* Botones principales inferiores */
#buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

#buttons button {
  flex: 1 1 auto;
  min-width: 120px;
}

/* Consola */
#output {
  flex-grow: 1;
  background: var(--console-bg);
  color: var(--console-text);
  font-family: "Consolas", "Courier New", monospace;
  font-size: 14px;
  line-height: 1.45;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--console-border);
  white-space: pre-wrap;
  word-wrap: break-word;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.18);
}

#output::-webkit-scrollbar {
  width: 10px;
}

#output::-webkit-scrollbar-thumb {
  background: #355C7D;
  border-radius: 10px;
}

#output::-webkit-scrollbar-track {
  background: #0B1F33;
}

/* Caja de créditos */
#credits_box {
  background: #0F172A;
  color: var(--green-main);
  padding: 7px 14px;
  border-radius: 9px;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  width: fit-content;
  border: 1px solid rgba(34, 197, 94, 0.55);
  user-select: none;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.08);
}

/* Contenedor del led + texto */
#led-group {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #F8FAFC;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 6px 10px;
}

#led-label {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.led-off,
.led-on {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.led-off {
  background: #334155;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.75), 0 1px 3px rgba(15, 23, 42, 0.25);
}

.led-on {
  background: var(--green-main);
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.9), inset 0 0 8px rgba(255, 255, 255, 0.4);
}

/* Panel de imágenes */
#mcp_plotter_panel {
  margin-top: 12px !important;
  background: #F8FAFC;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 10px;
}

#mcp_plotter_img {
  max-width: 100% !important;
  border: 1px solid var(--border-soft) !important;
  border-radius: 8px;
  background: #FFFFFF;
  display: block;
}

/* Inputs y tablas dentro de modales */
input,
select,
textarea {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 7px 9px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--blue-main);
  box-shadow: 0 0 0 3px rgba(77, 150, 255, 0.16);
}

table {
  border-color: var(--border-light) !important;
}

th {
  background: var(--blue-soft);
  color: var(--text-main);
}

td,
th {
  border-color: var(--border-light) !important;
}

/* Ajustes suaves para los modales que tienen estilos inline en index.html */
#pinConfigModal > div,
#creditsModal > div,
#voiceModal > div,
#serverMessageModal > div {
  border-radius: 14px !important;
  border: 1px solid var(--border-light);
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.25) !important;
}

#pinConfigModal h3,
#creditsModal h3,
#voiceModal h3,
#serverMessageModal h3 {
  color: var(--text-main);
}

#voiceTimer {
  color: var(--blue-main);
}

#voiceStatus {
  color: var(--text-main) !important;
}

/* Botón destructivo del modal de créditos */
#creditsModal button[onclick="requestDisableSharedKey()"] {
  background: var(--red-main) !important;
  border-color: var(--red-main) !important;
  color: #FFFFFF !important;
}

#creditsModal button[onclick="requestDisableSharedKey()"]:hover {
  background: #DC2626 !important;
}

/* Responsive simple */
@media (max-width: 900px) {
  #container {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  #left-panel {
    width: 100%;
    min-width: 0;
  }

  #right-panel {
    min-height: 500px;
  }
}
