/* =========================================================
   CODERN
   Theme Toggle
   ========================================================= */

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}


/* ---------------------------------------------------------
   Theme Toggle
   --------------------------------------------------------- */

.theme-toggle {
  position: relative;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 92px;
  height: 42px;

  padding: 0 14px;

  gap: 8px;

  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.12));
  border-radius: 999px;

  background: var(
    --color-surface,
    rgba(255, 255, 255, 0.05)
  );

  color: var(
    --color-text-primary,
    #ffffff
  );

  font-family: var(--font-family-primary, inherit);
  font-size: 0.82rem;
  font-weight: 700;

  line-height: 1;

  cursor: pointer;

  user-select: none;

  transition:
    background-color var(--theme-transition-duration, 250ms)
      var(--theme-transition-easing, ease),
    border-color var(--theme-transition-duration, 250ms)
      var(--theme-transition-easing, ease),
    color var(--theme-transition-duration, 250ms)
      var(--theme-transition-easing, ease),
    box-shadow var(--theme-transition-duration, 250ms)
      var(--theme-transition-easing, ease),
    transform 180ms ease;
}


/* Hover */

.theme-toggle:hover {
  border-color: var(
    --color-primary,
    #ff6b35
  );

  background: var(
    --color-surface-hover,
    rgba(255, 255, 255, 0.09)
  );

  box-shadow:
    0 0 0 3px
    color-mix(
      in srgb,
      var(--color-primary, #ff6b35) 12%,
      transparent
    );
}


/* Active */

.theme-toggle:active {
  transform: scale(0.96);
}


/* Keyboard focus */

.theme-toggle:focus-visible {
  outline: 2px solid var(
    --color-primary,
    #ff6b35
  );

  outline-offset: 3px;
}


/* ---------------------------------------------------------
   Icons
   --------------------------------------------------------- */

.theme-toggle-icon {
  display: inline-flex;

  align-items: center;
  justify-content: center;

  width: 18px;
  height: 18px;

  font-size: 17px;

  flex-shrink: 0;

  transition:
    transform 300ms ease,
    opacity 300ms ease;
}


/* Dark mode */

html[data-theme="dark"] .theme-toggle-sun {
  display: inline-flex;
}

html[data-theme="dark"] .theme-toggle-moon {
  display: none;
}


/* Light mode */

html[data-theme="light"] .theme-toggle-sun {
  display: none;
}

html[data-theme="light"] .theme-toggle-moon {
  display: inline-flex;
}


/* ---------------------------------------------------------
   Button Text
   --------------------------------------------------------- */

.theme-toggle-text {
  white-space: nowrap;
}


/* Dark mode button text */

html[data-theme="dark"] .theme-toggle-text::after {
  content: "";
}


/* Light mode */

html[data-theme="light"] .theme-toggle-text {
  font-size: 0;
}

html[data-theme="light"] .theme-toggle-text::after {
  content: "Dark";

  font-size: 0.82rem;
}


/* ---------------------------------------------------------
   Light Theme
   --------------------------------------------------------- */

html[data-theme="light"] .theme-toggle {
  background: var(
    --color-surface,
    #ffffff
  );

  border-color: var(
    --color-border,
    #e5e7eb
  );

  color: var(
    --color-text-primary,
    #111827
  );
}

html[data-theme="light"] .theme-toggle:hover {
  background: var(
    --color-surface-hover,
    #f3f4f6
  );

  border-color: var(
    --color-primary,
    #ff6b35
  );
}


/* ---------------------------------------------------------
   Mobile
   --------------------------------------------------------- */

@media (max-width: 1023px) {
  .header-actions {
    display: none;
  }
}


/* ---------------------------------------------------------
   Reduced Motion
   --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .theme-toggle,
  .theme-toggle-icon {
    transition: none;
  }
}