/* ===== v280: FIX DEFINITIVO BOTÓN DÍA / NOCHE =====
   Este archivo solo toca el botón de tema.
   Objetivo: una sola apariencia clara, estable y usable en PC/celular.
*/

html body #themeBtn,
html body #themeBtn.tv-theme-switch,
html body #themeBtn.tv-theme-switch-v271,
html body #themeBtn.tv-theme-switch-v280 {
  appearance: none !important;
  -webkit-appearance: none !important;
  position: relative !important;
  isolation: isolate !important;
  overflow: hidden !important;
  display: inline-grid !important;
  grid-template-columns: auto auto !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: auto !important;
  min-width: 132px !important;
  height: 52px !important;
  min-height: 52px !important;
  padding: 6px 13px 6px 7px !important;
  border-radius: 999px !important;
  border: 1px solid color-mix(in srgb, var(--accent, #ff9f27) 28%, var(--line, rgba(255,255,255,.18))) !important;
  background:
    radial-gradient(circle at 18% 20%, rgba(255,255,255,.16), transparent 26%),
    linear-gradient(135deg, rgba(255, 184, 74, .20), rgba(20, 29, 52, .94)) !important;
  color: var(--text, #f7f9ff) !important;
  box-shadow: 0 14px 30px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.10) !important;
  cursor: pointer !important;
  user-select: none !important;
  -webkit-tap-highlight-color: transparent !important;
  touch-action: manipulation !important;
  transform: translateZ(0) !important;
}

html body #themeBtn.tv-theme-switch-v280::before,
html body #themeBtn.tv-theme-switch-v280::after {
  content: none !important;
  display: none !important;
}

html body #themeBtn.tv-theme-switch-v280:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent, #ff9f27) 62%, transparent) !important;
  outline-offset: 3px !important;
}

html body #themeBtn.tv-theme-switch-v280 .theme-switch-track {
  position: relative !important;
  display: block !important;
  width: 54px !important;
  height: 30px !important;
  padding: 3px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  background: linear-gradient(135deg, #ffd684, #ff9f27) !important;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.24) !important;
  pointer-events: none !important;
}

html[data-theme="dark"] body #themeBtn.tv-theme-switch-v280 .theme-switch-track {
  background: linear-gradient(135deg, #111a31, #263760) !important;
  border-color: rgba(255,255,255,.20) !important;
}

html body #themeBtn.tv-theme-switch-v280 .theme-switch-icon {
  position: absolute !important;
  top: 50% !important;
  z-index: 1 !important;
  display: grid !important;
  place-items: center !important;
  width: 18px !important;
  height: 18px !important;
  transform: translateY(-50%) !important;
  font-size: 11px !important;
  line-height: 1 !important;
  opacity: .78 !important;
  pointer-events: none !important;
}

html body #themeBtn.tv-theme-switch-v280 .theme-switch-sun {
  left: 7px !important;
}

html body #themeBtn.tv-theme-switch-v280 .theme-switch-moon {
  right: 7px !important;
}

html body #themeBtn.tv-theme-switch-v280 .theme-switch-thumb {
  position: absolute !important;
  top: 3px !important;
  left: 3px !important;
  z-index: 2 !important;
  display: grid !important;
  place-items: center !important;
  width: 24px !important;
  height: 24px !important;
  border-radius: 999px !important;
  background: #fff8e7 !important;
  color: #7a3b00 !important;
  font-size: 13px !important;
  line-height: 1 !important;
  box-shadow: 0 5px 13px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.82) !important;
  transform: translateX(0) !important;
  transition: transform .22s ease, background .22s ease, color .22s ease !important;
  pointer-events: none !important;
}

html[data-theme="dark"] body #themeBtn.tv-theme-switch-v280 .theme-switch-thumb {
  transform: translateX(24px) !important;
  background: #f4f7ff !important;
  color: #17213a !important;
}

html body #themeBtn.tv-theme-switch-v280 .theme-switch-label {
  display: block !important;
  min-width: 43px !important;
  max-width: 64px !important;
  overflow: hidden !important;
  color: var(--text, #f7f9ff) !important;
  font-size: 13px !important;
  font-weight: 1000 !important;
  letter-spacing: -.02em !important;
  line-height: 1 !important;
  text-align: left !important;
  text-shadow: 0 1px 1px rgba(0,0,0,.18) !important;
  white-space: nowrap !important;
  pointer-events: none !important;
}

html[data-theme="light"] body #themeBtn.tv-theme-switch-v280 {
  background:
    radial-gradient(circle at 18% 20%, rgba(255,255,255,.55), transparent 32%),
    linear-gradient(135deg, #fff8ea, #ffd894) !important;
  color: #291704 !important;
}

html[data-theme="light"] body #themeBtn.tv-theme-switch-v280 .theme-switch-label {
  color: #291704 !important;
  text-shadow: none !important;
}

html body #themeBtn.tv-theme-switch-v280.is-switching .theme-switch-thumb {
  transition-duration: .12s !important;
}

@media (max-width: 980px) {
  html body #themeBtn,
  html body #themeBtn.tv-theme-switch,
  html body #themeBtn.tv-theme-switch-v271,
  html body #themeBtn.tv-theme-switch-v280 {
    width: 100% !important;
    min-width: 0 !important;
    height: 43px !important;
    min-height: 43px !important;
    padding: 5px 8px !important;
    border-radius: 15px !important;
    gap: 7px !important;
  }

  html body #themeBtn.tv-theme-switch-v280 .theme-switch-track {
    width: 48px !important;
    height: 27px !important;
    padding: 3px !important;
  }

  html body #themeBtn.tv-theme-switch-v280 .theme-switch-thumb {
    width: 21px !important;
    height: 21px !important;
    font-size: 12px !important;
  }

  html[data-theme="dark"] body #themeBtn.tv-theme-switch-v280 .theme-switch-thumb {
    transform: translateX(21px) !important;
  }

  html body #themeBtn.tv-theme-switch-v280 .theme-switch-icon {
    width: 16px !important;
    height: 16px !important;
    font-size: 10px !important;
  }

  html body #themeBtn.tv-theme-switch-v280 .theme-switch-label {
    min-width: 36px !important;
    max-width: 46px !important;
    font-size: 10.5px !important;
  }
}

@media (max-width: 390px) {
  html body #themeBtn,
  html body #themeBtn.tv-theme-switch,
  html body #themeBtn.tv-theme-switch-v271,
  html body #themeBtn.tv-theme-switch-v280 {
    gap: 5px !important;
    padding: 5px 6px !important;
  }

  html body #themeBtn.tv-theme-switch-v280 .theme-switch-track {
    width: 45px !important;
    height: 25px !important;
  }

  html body #themeBtn.tv-theme-switch-v280 .theme-switch-thumb {
    width: 19px !important;
    height: 19px !important;
    font-size: 11px !important;
  }

  html[data-theme="dark"] body #themeBtn.tv-theme-switch-v280 .theme-switch-thumb {
    transform: translateX(20px) !important;
  }

  html body #themeBtn.tv-theme-switch-v280 .theme-switch-label {
    min-width: 31px !important;
    max-width: 39px !important;
    font-size: 9.8px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body #themeBtn.tv-theme-switch-v280 .theme-switch-thumb {
    transition: none !important;
  }
}
