/* ============================================================
   Convertidor Académico Online — Estilo Premium Mascoalba
   ============================================================ */

/* -----------------------------
   RESET SUAVE
----------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: #f7f7f9;
  color: #222;
  line-height: 1.6;
  padding-bottom: 120px;
  transition: background 0.3s ease, color 0.3s ease;
}

/* -----------------------------
   CONTENEDOR PRINCIPAL
----------------------------- */
.contenedor-premium {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
}

/* -----------------------------
   CABECERA DE LA HERRAMIENTA
----------------------------- */
.cabecera-herramienta {
  text-align: center;
  margin-bottom: 40px;
}

.titulo-principal {
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.descripcion-herramienta {
  font-size: 1.1rem;
  color: #444;
  max-width: 750px;
  margin: 0 auto;
}

/* -----------------------------
   SELECTOR DE HERRAMIENTAS
----------------------------- */
.ma-tool-selector {
  margin-bottom: 30px;
  text-align: center;
}

.ma-section-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 15px;
}

.ma-tool-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.ma-tool-button {
  background: #e9e9ee;
  border: none;
  padding: 12px 20px;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.15s ease;
  min-width: 200px;
  text-align: center;
}

.ma-tool-button:hover {
  background: #dcdce3;
  transform: translateY(-2px);
}

.ma-tool-button--active {
  background: #4a4ae6;
  color: white;
  font-weight: 600;
}

/* -----------------------------
   CONTENEDOR DE CADA HERRAMIENTA
----------------------------- */
.ma-tool {
  display: none;
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);

  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.ma-tool--active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.ma-tool-title {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.ma-tool-description {
  color: #555;
  margin-bottom: 25px;
}

/* -----------------------------
   FORMULARIOS
----------------------------- */
.ma-form-group {
  margin-bottom: 20px;
}

.ma-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.ma-input,
.ma-input-file,
.ma-textarea,
.ma-select {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  background: #fafafa;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.ma-input:focus,
.ma-textarea:focus,
.ma-select:focus {
  border-color: #4a4ae6;
  background: white;
  outline: none;
  box-shadow: 0 0 0 2px rgba(74, 74, 230, 0.15);
}

/* -----------------------------
   BARRA DE ACCIONES PREMIUM
----------------------------- */
.ma-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 15px 0;
  align-items: center;
}

.ma-action-btn {
  background: #ececf5;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.25s ease, transform 0.15s ease;
}

.ma-action-btn:hover {
  background: #dcdcef;
  transform: translateY(-2px);
}

.ma-contador {
  margin-left: auto;
  font-size: 0.9rem;
  color: #666;
}

/* -----------------------------
   CHIPS (MODOS DE RESUMEN)
----------------------------- */
.chips {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.chip {
  padding: 8px 16px;
  border-radius: 20px;
  background: #e9e9ee;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.25s ease, transform 0.15s ease;
}

.chip:hover {
  background: #dcdce3;
}

.chip--active {
  background: #4a4ae6;
  color: white;
  font-weight: 600;
}

/* -----------------------------
   LOADER PREMIUM
----------------------------- */
.ma-loading {
  width: 32px;
  height: 32px;
  border: 3px solid #d0d0d0;
  border-top-color: #007bff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 15px auto;
}

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

/* -----------------------------
   MODO OSCURO
----------------------------- */
body.dark {
  background: #1a1a1d;
  color: #eee;
}

body.dark .ma-tool {
  background: #2a2a2e;
}

body.dark .ma-input,
body.dark .ma-textarea {
  background: #333;
  color: #fff;
  border-color: #555;
}

body.dark .ma-tool-button {
  background: #333;
  color: #eee;
}

body.dark .chip {
  background: #333;
  color: #eee;
}

body.dark .chip--active {
  background: #4a4ae6;
  color: white;
}

/* -----------------------------
   BOTÓN FLOTANTE MODO OSCURO (GLASSMORPHISM)
----------------------------- */
/* Botón modo oscuro */
.modo-oscuro-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 20px;
  z-index: 9999;
  transition: all 0.3s ease;
}

.modo-oscuro-btn:hover {
  background: rgba(255,255,255,0.25);
}

/* MODO OSCURO ACTIVADO */
body.dark {
  background: #0d0d0d;
  color: #ffffff;
}

/* Ajustes generales en modo oscuro */
body.dark .ma-tool,
body.dark .contenedor-premium {
  background: #1a1a1a;
  color: #ffffff;
}

body.dark .ma-textarea,
body.dark .ma-input,
body.dark .ma-input-file {
  background: #111;
  color: #fff;
  border-color: #444;
}

body.dark .ma-tool-title {
  color: #ffd84d !important; /* amarillo premium */
}

body.dark .ma-tool-description {
  color: #ffffff !important;
}


/* -----------------------------
   RESPONSIVE
----------------------------- */
@media (max-width: 600px) {
  .titulo-principal {
    font-size: 1.9rem;
  }

  .ma-tool-button,
  .ma-button {
    min-width: 100%;
  }

  .ma-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .ma-contador {
    margin-left: 0;
  }
}

/* FIX — Prioridad para modo oscuro dentro del conversor */
body.dark .contenedor-premium,
body.dark .contenedor-premium * {
  color: #eee !important;
  border-color: #555 !important;
}

/* FIX — Botones de acción visibles en modo oscuro (móvil y escritorio) */
body.dark .ma-action-btn {
  background: #3a3a3f !important;
  color: #fff !important;
  border: 1px solid #555 !important;
}

body.dark .ma-action-btn:hover {
  background: #4a4a50 !important;
}

/* FIX — Textos y títulos visibles en modo oscuro dentro del conversor */
body.dark .contenedor-premium .titulo-principal,
body.dark .contenedor-premium .descripcion-herramienta,
body.dark .contenedor-premium .ma-section-title,
body.dark .contenedor-premium .ma-tool-title,
body.dark .contenedor-premium .ma-tool-description {
  color: #f5f5f5 !important;
}

/* Aseguramos también el texto general dentro de las herramientas */
body.dark .contenedor-premium .ma-tool,
body.dark .contenedor-premium .ma-tool * {
  color: #eaeaea !important;
}

/* FIX — Descripciones visibles en modo oscuro (PC y móvil) */
body.dark .ma-tool-description,
body.dark .ma-tool-description * {
  color: #f0f0f0 !important;
}

body.dark .ma-tool-title,
body.dark .ma-tool-title * {
  color: #ffffff !important;
}

body.dark .ma-tool p {
  color: #e6e6e6 !important;
}

/* FIX — Títulos y descripciones visibles en modo oscuro (PC) */
body.dark .ma-tool-title,
body.dark .ma-tool-description,
body.dark .ma-tool-description p,
body.dark .ma-tool-header p {
  color: #ffffff !important;
}

/* FIX — Input file visible en modo oscuro (móvil y PC) */
body.dark input[type="file"] {
  background-color: #3a3a3f !important;
  color: #ffffff !important;
  border: 1px solid #555 !important;
}

body.dark input[type="file"]::file-selector-button {
  background-color: #4a4a50 !important;
  color: #ffffff !important;
  border: none !important;
}

body.dark .ma-tool-button {
  background: #4a4a50 !important;
  color: #ffffff !important;
  border: 1px solid #666 !important;
}

/* Modo oscuro — Título OCR siempre blanco */
body.dark #tool-ocr .ma-tool-title {
  color: #ffffff !important;
}

/* Modo oscuro — Descripción OCR: emoji blanco + texto amarillo suave */
body.dark #tool-ocr .ma-tool-description {
  color: #ffe680 !important; /* emoji */
}

body.dark #tool-ocr .ma-tool-description .ocr-desc {
  color: #ffffff !important; /* amarillo premium suave */
}

/* Modo día — descripción OCR en blanco */
#tool-ocr .ma-tool-description {
  color: #ffffff !important;
}

/* ============================================================
   ESTILOS FIJOS (DÍA Y NOCHE) SEGÚN PETICIÓN DE REFLEJOS
   ============================================================ */

/* 1) TÍTULOS SIEMPRE AMARILLO */
#tool-pdf .ma-tool-title,
#tool-citas .ma-tool-title,
#tool-resumen .ma-tool-title {
  color: #ffd84d !important; /* amarillo premium */
}

/* 2) DESCRIPCIONES SIEMPRE BLANCAS */
#tool-ocr .ma-tool-description,
#tool-pdf .ma-tool-description,
#tool-citas .ma-tool-description {
  color: #ffffff !important;
}

/* Para asegurar que los <p> internos también sean blancos */
#tool-ocr .ma-tool-description p,
#tool-pdf .ma-tool-description p,
#tool-citas .ma-tool-description p {
  color: #ffffff !important;
}

/* Título OCR siempre amarillo */
#tool-ocr .ma-tool-title {
  color: #ffd84d !important; /* amarillo premium */
}

#tool-resumen .ma-tool-description

/* Modo oscuro — descripción del módulo Resumen en blanco */
body.dark #tool-resumen .ma-tool-description,
body.dark #tool-resumen .ma-tool-description * {
  color: #ffffff !important;
}

/* Modo oscuro — título OCR en amarillo */
body.dark #tool-ocr .ma-tool-title {
  color: #ffd84d !important; /* amarillo premium */
}

/* Modo día — descripción del módulo Resumen siempre blanca */
#tool-resumen .ma-tool-description,
#tool-resumen .ma-tool-description p,
#tool-resumen .ma-tool-header .ma-tool-description {
  color: #ffffff !important;
}

/* ===========================================
   MODO OSCURO — Botón activo resaltado
=========================================== */
body.dark .ma-tool-button--active {
  background: #ffd84d !important;   /* amarillo premium */
  color: #000 !important;           /* texto negro para contraste */
  border-color: #ffd84d !important;
}

/* Opcional: botones no activos en modo oscuro */
body.dark .ma-tool-button {
  background: #222;
  color: #fff;
  border-color: #444;
}

/* Separación entre el título del resumen y los chips */
#tool-resumen .chips {
  margin-top: 18px;   /* separación vertical */
  display: flex;
  gap: 10px;          /* separación entre chips */
}

/* Opcional: que los chips no se peguen a los lados */
#tool-resumen .chips .chip {
  padding: 8px 14px;
  border-radius: 8px;
}

/* Contenedor principal más ancho */
/* Contenedor principal REAL */
.contenedor-premium {
  width: 98%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 10px;
}
.ma-tool-container {
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 10px;
}






/* ===========================================
   BOTONES OCR CON EMOJIS PREMIUM MASCOALBA
=========================================== */

/* Botón "Extraer texto" */
.ma-ocr-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffd84d;
  color: #000;
  font-weight: 600;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.25s ease;
}

.ma-ocr-btn:hover {
  background: #ffcc33;
  transform: translateY(-1px);
}

/* Botón "Selecciona una imagen" (input file) */
.ma-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #333;
}

/* MODO OSCURO */
body.dark .ma-ocr-btn {
  background: #ffb300;
  color: #000;
}

body.dark .ma-ocr-btn:hover {
  background: #ff9900;
}

body.dark .ma-label {
  color: #fff;
}

/* ===========================================
   MODO CLARO — Hover negro en botones de herramientas
=========================================== */
body:not(.dark) .ma-tool-button:hover {
  background: #000 !important;
  color: #fff !important;
  border-color: #000 !important;
}

/* Botón amarillo premium para seleccionar archivo */
.ma-label[for="ocr-file"],
.ma-label[for="pdf-input"] {
  display: inline-block;
  background: #ffd84d;        /* amarillo premium */
  color: #000;                /* texto negro */
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.25s ease;
  border: 2px solid #e6c23f;
}

.ma-label[for="ocr-file"]:hover,
.ma-label[for="pdf-input"]:hover {
  background: #ffcc33;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Modo oscuro */
body.dark .ma-label[for="ocr-file"],
body.dark .ma-label[for="pdf-input"] {
  background: #ffb300;
  color: #000;
  border-color: #e69a00;
}

body.dark .ma-label[for="ocr-file"]:hover,
body.dark .ma-label[for="pdf-input"]:hover {
  background: #ff9900;
}

/* Botones de descarga (TXT / PDF) en verde */
.ma-action-btn[data-action="txt"],
.ma-action-btn[data-action="pdf"] {
  background: #2ecc71;        /* verde bonito */
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.25s ease;
}

.ma-action-btn[data-action="txt"]:hover,
.ma-action-btn[data-action="pdf"]:hover {
  background: #27ae60;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Modo oscuro */
body.dark .ma-action-btn[data-action="txt"],
body.dark .ma-action-btn[data-action="pdf"] {
  background: #1f8f4d;
}

body.dark .ma-action-btn[data-action="txt"]:hover,
body.dark .ma-action-btn[data-action="pdf"]:hover {
  background: #166b39;
}

/* Ocultar el input file real */
.ma-input-file {
  display: none !important;
}

/* Botón amarillo premium para seleccionar archivo */
.ma-label[for="ocr-file"],
.ma-label[for="pdf-input"] {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #ffd84d;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid #e6c23f;
  transition: 0.25s ease;
  width: auto !important;
}

/* Hover */
.ma-label[for="ocr-file"]:hover,
.ma-label[for="pdf-input"]:hover {
  background: #ffcc33;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Modo oscuro */
body.dark .ma-label[for="ocr-file"],
body.dark .ma-label[for="pdf-input"] {
  background: #ffb300;
  border-color: #e69a00;
  color: #000;
}

/* Botón verde premium para EXTRAER TEXTO */
.ma-ocr-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #2ecc71;        /* verde bonito profesional */
  color: #fff;                /* texto blanco */
  font-weight: 600;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.25s ease;
}

/* Hover elegante */
.ma-ocr-btn:hover {
  background: #27ae60;        /* verde más oscuro */
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Modo oscuro */
body.dark .ma-ocr-btn {
  background: #1f8f4d;        /* verde oscuro premium */
  color: #fff;
}

body.dark .ma-ocr-btn:hover {
  background: #166b39;
}

/* Forzar fondo y color en modo oscuro con máxima prioridad */
body.dark, html.dark, .dark body {
  background: #0d0d0d !important;
  color: #ffffff !important;
}

/* Asegurar contenedor principal */
body.dark .contenedor-premium {
  background: #111 !important;
  color: #ffffff !important;
}

/* Asegurar textarea e inputs */
body.dark .ma-textarea,
body.dark .ma-input,
body.dark input[type="file"] {
  background: #111 !important;
  color: #fff !important;
  border-color: #444 !important;
}
