/* ==============================================
   AGROINGENIO LAB - UI POLISH
   Tema limpio + asistente compacto en movil
============================================== */

/* BOTON DE TEMA SIN EMOJI DEL SISTEMA */
.theme-toggle {
  position: relative !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 50% !important;
  font-size: 0 !important;
  line-height: 1 !important;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(34,197,94,.06) !important;
  transition: background .25s ease, transform .25s ease;
}

.theme-toggle:active {
  transform: scale(.94);
}

/* SOL - cuando la pagina esta en modo oscuro */
body:not(.light) .theme-toggle::before {
  content: "";
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #dbe5df;
  box-shadow:
    0 -10px 0 -3px #dbe5df,
    0 10px 0 -3px #dbe5df,
    10px 0 0 -3px #dbe5df,
    -10px 0 0 -3px #dbe5df,
    7px 7px 0 -3px #dbe5df,
    -7px -7px 0 -3px #dbe5df,
    7px -7px 0 -3px #dbe5df,
    -7px 7px 0 -3px #dbe5df;
}

/* LUNA - cuando la pagina esta en modo claro */
body.light .theme-toggle {
  background: rgba(22,163,74,.065) !important;
}

body.light .theme-toggle::before {
  content: "";
  display: block;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: transparent;
  box-shadow: -5px 3px 0 1px #334155;
}

/* ==============================================
   ASISTENTE COMPACTO SOLO EN MOVIL
============================================== */

@media (max-width: 700px) {

  .agro-assistant-launcher {
    width: 58px !important;
    min-width: 58px !important;
    max-width: 58px !important;
    height: 58px !important;
    min-height: 58px !important;
    padding: 6px !important;
    gap: 0 !important;
    justify-content: center !important;
    align-items: center !important;
    border-radius: 50% !important;
  }

  .agro-assistant-launcher span {
    display: none !important;
  }

  .agro-assistant-launcher img {
    width: 46px !important;
    height: 46px !important;
    margin: 0 !important;
    object-fit: contain !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle {
    transition: none !important;
  }
}

/* ==============================================
   AGRO-UI-FINAL-TUNING
   Ajustes finos de contraste y profundidad
============================================== */

/* Sol mas discreto en modo oscuro */
body:not(.light) .theme-toggle {
  background: rgba(34, 197, 94, 0.035) !important;
}

body:not(.light) .theme-toggle::before {
  background: rgba(219, 229, 223, 0.88);
  box-shadow:
    0 -10px 0 -3px rgba(219,229,223,.78),
    0 10px 0 -3px rgba(219,229,223,.78),
    10px 0 0 -3px rgba(219,229,223,.78),
    -10px 0 0 -3px rgba(219,229,223,.78),
    7px 7px 0 -3px rgba(219,229,223,.72),
    -7px -7px 0 -3px rgba(219,229,223,.72),
    7px -7px 0 -3px rgba(219,229,223,.72),
    -7px 7px 0 -3px rgba(219,229,223,.72);
}

/* Asistente mas suave sobre fondo claro */
body.light .agro-assistant-launcher {
  box-shadow:
    0 6px 16px rgba(15, 23, 42, 0.10),
    0 0 0 1px rgba(22, 163, 74, 0.08) !important;
}

/* Mantener presencia elegante en oscuro */
body:not(.light) .agro-assistant-launcher {
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(74, 222, 128, 0.08) !important;
}

/* ==============================================
   AGRO-SUN-LINE-ICON
   Sol limpio de lineas, sin apariencia de spinner
============================================== */

body:not(.light) .theme-toggle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(226, 235, 230, .92);
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}

body:not(.light) .theme-toggle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 27px;
  height: 27px;
  transform: translate(-50%, -50%);
  color: rgba(226, 235, 230, .78);
  background:
    linear-gradient(currentColor, currentColor) 50% 0 / 2px 5px no-repeat,
    linear-gradient(currentColor, currentColor) 50% 100% / 2px 5px no-repeat,
    linear-gradient(currentColor, currentColor) 0 50% / 5px 2px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 50% / 5px 2px no-repeat;
  pointer-events: none;
}

body.light .theme-toggle::after {
  content: none;
}
