/* Smooth dark mode transition */
html.transitioning,
html.transitioning *,
html.transitioning *::before,
html.transitioning *::after {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.2s ease, box-shadow 0.3s ease !important;
}

body {
  background: #f5f7fb;
}

html.dark body {
  background: #0f1117;
}

input,
select {
  width: 100%;
}

/* Dark mode scrollbar */
html.dark ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
html.dark ::-webkit-scrollbar-track {
  background: #1e2030;
}
html.dark ::-webkit-scrollbar-thumb {
  background: #3b4063;
  border-radius: 4px;
}

/* Theme toggle animation */
.theme-toggle {
  position: relative;
  overflow: hidden;
}
.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  transition: transform 0.3s ease, opacity 0.3s ease;
}
html.dark .theme-toggle .icon-sun {
  transform: rotate(90deg) scale(0);
  opacity: 0;
}
html:not(.dark) .theme-toggle .icon-moon {
  transform: rotate(-90deg) scale(0);
  opacity: 0;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
html.dark .theme-toggle .icon-moon {
  transform: rotate(0deg) scale(1);
  opacity: 1;
}

/* Message auto-dismiss */
@keyframes fadeSlideUp {
  0% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-8px); }
}
.message-auto-dismiss {
  animation: fadeSlideUp 5s ease-in-out forwards;
}
