/* Theme Toggle — MediaPlan.dev */
.theme-toggle {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.75rem;
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  color: #333;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  transition: background 0.15s, box-shadow 0.15s;
  line-height: 1;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.theme-toggle-icon {
  font-size: 0.85rem;
}

.theme-toggle-label {
  font-weight: 500;
}

.theme-toggle-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 0.4rem);
  right: 0;
  min-width: 120px;
  padding: 0.3rem 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  list-style: none;
}

.theme-toggle-menu-open {
  display: block;
}

.theme-toggle-option {
  display: block;
  width: 100%;
  padding: 0.4rem 0.75rem;
  border: none;
  background: none;
  font: inherit;
  color: #333;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.1s;
}

.theme-toggle-option:hover {
  background: rgba(0, 0, 0, 0.05);
}

.theme-toggle-active {
  font-weight: 600;
  color: #0066cc;
}

.theme-toggle[data-pending="true"] .theme-toggle-btn {
  opacity: 0.8;
}

.theme-toggle-option:disabled {
  opacity: 0.55;
  cursor: wait;
}

.theme-toggle-status {
  display: none;
  max-width: 240px;
  margin-top: 0.45rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
  color: #333;
  line-height: 1.4;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.theme-toggle-status-visible {
  display: block;
}

.theme-toggle-status-pending {
  color: #4b5563;
}

.theme-toggle-status-error {
  border-color: rgba(185, 28, 28, 0.22);
  background: rgba(254, 242, 242, 0.98);
  color: #b91c1c;
}
