/* ======================================
   🎨 THEMES
====================================== */

body.dark {
  background: #0d1117;
  color: #fff;
}

body.light {
  background: #f5f5f5;
  color: #222;
}

/* ===============================
   ESTILOS GENERALES
=============================== */

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 15px;
  height: 100%;
  overflow-y: scroll;
  scroll-behavior: smooth;
}

#home {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

/* ===============================
   TABS
=============================== */

.tab-button {
  background: none;
  border: 1px solid #00ccaa;
  color: #00ccaa;
  padding: 10px;
  margin: 5px 0;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.tab-button:hover {
  background-color: #00ffcc22;
}

.tab-button.active {
  background-color: #00ffcc;
  color: #000;
  font-weight: bold;
}

/* LIGHT MODE: botones */
body.light .tab-button {
  border-color: #007bff;
  color: #007bff;
}

body.light .tab-button:hover {
  background-color: #007bff22;
}

body.light .tab-button.active {
  background: #007bff;
  color: white;
}

/* ===============================
   CONTENIDO DE TABS
=============================== */

.tab-content {
  display: none;
  width: calc(100% - 50px);
  padding: 20px;
  border-radius: 8px;
  background-color: #111;
  box-shadow: 0 0 10px #00ffcc33;
}

.tab-content.active {
  display: block;
}

/* Light Mode */
body.light .tab-content {
  background: #f8f8f8;
  color: #000;
  box-shadow: 0 0 10px #bbbbbb66;
}

/* ===============================
   IMÁGENES
=============================== */

.imageslist {
  display: inline-block;
  flex-wrap: nowrap;
  gap: 12px;
  padding: 10px 0;
}

.image-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: #111;
  border: 1px solid #00ffcc55;
  border-radius: 10px;
  padding: 8px;
  min-width: 110px;
  max-width: 90px;
  text-align: center;
  flex-shrink: 0;
  box-shadow: 0 0 5px #00ffcc33;
}

.image-card img {
  width: 100px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

.image-info {
  font-size: 70%;
  margin-top: 5px;
  color: #ccc;
}

.image-info strong {
  color: #00ffcc;
}

/* Light Mode */
body.light .image-card {
  background: white;
  border: 1px solid #d0d0d0;
  box-shadow: 0 0 5px #d0d0d099;
}

body.light .image-info {
  color: #555;
}

body.light .image-info strong {
  color: #007bff;
}

/* ===============================
   CÓDIGO
=============================== */

pre {
  background: #0b0d11;
  padding: 10px;
  border-radius: 6px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 1.6em;
}

/* Light mode */
body.light pre {
  background: #eeeeee;
  color: #111;
}

/* ===============================
   SWITCH DARK/LIGHT
=============================== */

.theme-switch {
  position: relative;
  width: 50px;
  height: 26px;
  display: inline-block;
}

.theme-switch input {
  display: none;
}

.slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #666;
  border-radius: 30px;
  cursor: pointer;
  transition: 0.3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
}

input:checked + .slider {
  background: #00ccff;
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* ===============================
   LOADING SPINNER
=============================== */

#loading-ia {
  display: none; /* cámbialo a flex cuando quieras mostrarlo */
  justify-content: center;
  align-items: center;
}

#loading-ia .spinner {
  width: 20px;
  height: 20px;
  border: 3px solid #ccc;
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
