.theme-toggle {
  min-width: fit-content;
  min-height: 40px;
  display: flex;
  align-items: center;
  cursor: pointer;
  border: none;
  padding: 0 10px;
  white-space: nowrap;
  color: var(--color-text-primary);
  transition: 0.3s ease;
  border-inline: 1px solid var(--text-4);
}

.sidebar-footer .theme-toggle:hover {
  background: var(--color-hover-secondary);
}

.theme-toggle .theme-label {
  display: flex;
  gap: 10px;
  align-items: center;
}

.theme-toggle .theme-label .theme-text {
  font-size: 1rem;
  transition: opacity 0.4s 0.2s ease;
}

.sidebar.collapsed .theme-toggle :where(.theme-text, .theme-toggle-track) {
  opacity: 0;
  width: 0;
  transition: all 0.2s ease;
}

.theme-toggle .theme-toggle-track {
  height: 24px;
  width: 48px;
  border-radius: 999px;
  margin-left: auto;
  background: #c3d1ec;
  position: relative;
  transition: opacity 0.4s 0.2s ease, background-color 0.3s ease;
}

body.dark-theme .theme-toggle-track {
  background: #695CFE;
}

.theme-toggle-track .theme-toggle-indicator {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

body.dark-theme .theme-toggle-indicator {
  transform: translateX(24px);
}

@media (max-width:1024px) {
  .theme-toggle {
    min-width: 100%;
    margin-right: 2px;
    background: var(--color-bg-secondary);
  }
}