/**
 * THEME TOGGLE FIX - Ensure toggle button works everywhere
 * Forces visibility and clickability on all devices
 */

/* Navbar theme toggle button */
#themeToggle {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  height: 40px !important;
  font-size: 18px !important;
  background: transparent !important;
  border: 2px solid rgba(var(--accent-color-rgb), 0.4) !important;
  border-radius: 8px !important;
  color: var(--accent-color) !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  z-index: 10000 !important;
  position: relative !important;
  transition: all 0.3s ease !important;
  padding: 0 !important;
  margin: 0 !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#themeToggle:hover {
  background: rgba(var(--accent-color-rgb), 0.1) !important;
  border-color: var(--accent-color) !important;
  transform: scale(1.05) !important;
}

#themeToggle:active {
  transform: scale(0.95) !important;
  background: rgba(var(--accent-color-rgb), 0.2) !important;
}

#themeToggle i {
  pointer-events: none !important;
  display: block !important;
}

/* Hero section theme toggle button */
#heroThemeToggle,
.hero-theme-toggle {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  height: 44px !important;
  font-size: 20px !important;
  color: var(--accent-color) !important;
  border: 2px solid var(--accent-color) !important;
  border-radius: 50% !important;
  background: transparent !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  z-index: 10000 !important;
  position: relative !important;
  transition: all 0.3s ease !important;
  padding: 0 !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#heroThemeToggle:hover,
.hero-theme-toggle:hover {
  transform: scale(1.05) rotate(10deg) !important;
  background: rgba(var(--accent-color-rgb), 0.1) !important;
  box-shadow: 0 0 15px rgba(var(--accent-color-rgb), 0.5) !important;
}

#heroThemeToggle:active,
.hero-theme-toggle:active {
  transform: scale(0.95) !important;
  background: rgba(var(--accent-color-rgb), 0.2) !important;
}

#heroThemeToggle i,
.hero-theme-toggle i {
  pointer-events: none !important;
  display: block !important;
}

/* Profile theme toggle button */
#profileThemeToggle {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  font-size: 16px !important;
  color: var(--accent-color) !important;
  border: 2px solid rgba(var(--accent-color-rgb), 0.4) !important;
  border-radius: 6px !important;
  background: transparent !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  z-index: 10000 !important;
  position: relative !important;
  transition: all 0.3s ease !important;
  padding: 0 !important;
  margin-left: 8px !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#profileThemeToggle:hover {
  background: rgba(var(--accent-color-rgb), 0.1) !important;
  border-color: var(--accent-color) !important;
  transform: scale(1.05) !important;
}

#profileThemeToggle:active {
  transform: scale(0.95) !important;
  background: rgba(var(--accent-color-rgb), 0.2) !important;
}

#profileThemeToggle i {
  pointer-events: none !important;
  display: block !important;
}

/* Theme toggles container */
.theme-toggles {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  pointer-events: auto !important;
  z-index: 10000 !important;
}

/* Mobile specific enhancements */
@media (max-width: 768px) {
  #themeToggle {
    width: 50px !important;
    height: 50px !important;
    font-size: 22px !important;
    border-width: 2px !important;
    border-radius: 50% !important;
  }

  #heroThemeToggle,
  .hero-theme-toggle {
    width: 54px !important;
    height: 54px !important;
    font-size: 24px !important;
    border-width: 3px !important;
  }

  #profileThemeToggle {
    width: 40px !important;
    height: 40px !important;
    font-size: 18px !important;
  }

  /* Add touch feedback */
  #themeToggle:active,
  #heroThemeToggle:active,
  .hero-theme-toggle:active,
  #profileThemeToggle:active {
    background: rgba(var(--accent-color-rgb), 0.3) !important;
  }
}

/* Ensure navbar li doesn't hide the button */
nav ul li {
  pointer-events: auto !important;
}

nav ul li button {
  pointer-events: auto !important;
}

/* Force visibility in all contexts */
button[id*="theme" i],
button[id*="Theme" i],
button[class*="theme" i] {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
