/* PulseGrid - Estilos personalizados complementarios a Tailwind CSS */

:root {
  color-scheme: dark;
}

/* Scrollbar sutil en modo oscuro */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #020617;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Range slider táctil y preciso para controles numéricos Tuya */
input[type="range"].pg-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 9999px;
  background: #1e293b;
  outline: none;
  cursor: pointer;
}

input[type="range"].pg-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  background: #38bdf8;
  border: 2px solid #0f172a;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
  transition: transform 0.12s ease, background-color 0.12s ease;
}

input[type="range"].pg-slider::-webkit-slider-thumb:hover {
  transform: scale(1.12);
  background: #7dd3fc;
}

input[type="range"].pg-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  background: #38bdf8;
  border: 2px solid #0f172a;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
  transition: transform 0.12s ease;
}

input[type="range"].pg-slider:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Toggle Switch accesible */
.pg-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 44px;
  height: 24px;
  border-radius: 9999px;
  background: #334155;
  transition: background-color 0.2s ease;
  cursor: pointer;
  flex-shrink: 0;
}

.pg-toggle[aria-checked="true"] {
  background: #10b981;
}

.pg-toggle[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.pg-toggle-thumb {
  position: absolute;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  background: #f8fafc;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pg-toggle[aria-checked="true"] .pg-toggle-thumb {
  transform: translateX(20px);
}

/* Animación sutil para toasts */
@keyframes pg-slide-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pg-toast {
  animation: pg-slide-in 0.18s ease-out;
}

/* ==========================================================================
   Tema Claro (Light Mode) — activado cuando <html class="light">
   ========================================================================== */
html.light {
  color-scheme: light;
}

html.light ::-webkit-scrollbar-track {
  background: #f1f5f9;
}
html.light ::-webkit-scrollbar-thumb {
  background: #cbd5e1;
}
html.light ::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

html.light body,
html.light .bg-slate-950 {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
}

html.light header.bg-slate-950\/85 {
  background-color: rgba(255, 255, 255, 0.9) !important;
}

html.light .bg-slate-950\/80 {
  background-color: rgba(15, 23, 42, 0.45) !important;
}

html.light .bg-slate-950\/70,
html.light .bg-slate-950\/40 {
  background-color: #f8fafc !important;
}

html.light .bg-slate-900,
html.light .bg-slate-900\/90,
html.light .bg-slate-900\/70,
html.light .bg-slate-900\/60,
html.light .bg-slate-900\/40 {
  background-color: #ffffff !important;
}

html.light .bg-slate-800,
html.light .bg-slate-800\/90 {
  background-color: #e2e8f0 !important;
}

html.light .hover\:bg-slate-800:hover,
html.light .hover\:bg-slate-700:hover,
html.light .hover\:bg-slate-900:hover {
  background-color: #cbd5e1 !important;
}

html.light .border-slate-800,
html.light .border-slate-800\/80,
html.light .border-slate-800\/70,
html.light .divide-slate-800\/70 > :not([hidden]) ~ :not([hidden]) {
  border-color: #e2e8f0 !important;
}

html.light .border-slate-700,
html.light .border-slate-700\/70,
html.light .border-slate-600 {
  border-color: #cbd5e1 !important;
}

html.light .text-slate-100 {
  color: #0f172a !important;
}
html.light .text-slate-200 {
  color: #1e293b !important;
}
html.light .text-slate-300 {
  color: #334155 !important;
}
html.light .text-slate-400 {
  color: #475569 !important;
}
html.light .text-slate-500 {
  color: #64748b !important;
}

html.light .text-sky-300,
html.light .text-sky-400 {
  color: #0284c7 !important;
}
html.light .text-emerald-300,
html.light .text-emerald-400 {
  color: #059669 !important;
}
html.light .text-amber-200,
html.light .text-amber-300,
html.light .text-amber-400 {
  color: #b45309 !important;
}
html.light .text-rose-200,
html.light .text-rose-300,
html.light .text-rose-400 {
  color: #be123c !important;
}
html.light .text-indigo-300 {
  color: #4338ca !important;
}

html.light .bg-rose-950\/70 {
  background-color: #fff1f2 !important;
}
html.light .text-rose-100 {
  color: #881337 !important;
}

html.light input,
html.light select,
html.light textarea {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

html.light select option {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

html.light input[type="range"].pg-slider {
  background: #cbd5e1;
}
html.light input[type="range"].pg-slider::-webkit-slider-thumb {
  background: #0284c7;
  border-color: #ffffff;
}
html.light .pg-toggle {
  background: #cbd5e1;
}
html.light .pg-toggle[aria-checked="true"] {
  background: #10b981;
}
html.light .pg-toast {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

