/**
 * Theme Toggle Button Styles
 */

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  width: 44px;
  height: 44px;
  border: var(--border);
  border-radius: 50%;
  background-color: var(--background-color);
  color: var(--text-color);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55),
              border-color 0.3s ease,
              box-shadow 0.3s ease,
              background-color 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  padding: 0;
  outline: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
}

.theme-toggle .theme-icon {
  width: 22px;
  height: 22px;
  color: var(--text-color);
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.15) rotate(20deg);
  border-color: var(--base-color);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.theme-toggle:active {
  transform: scale(0.9);
}

.theme-toggle--animating {
  animation: theme-toggle-morph 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes theme-toggle-morph {
  0% {
    transform: rotate(0deg) scale(1);
    opacity: 1;
  }
  25% {
    transform: rotate(90deg) scale(0.8);
    opacity: 0.8;
  }
  50% {
    transform: rotate(180deg) scale(0.6);
    opacity: 0.6;
    filter: blur(2px);
  }
  75% {
    transform: rotate(270deg) scale(0.8);
    opacity: 0.8;
  }
  100% {
    transform: rotate(360deg) scale(1);
    opacity: 1;
  }
}

/* Mobile positioning - move to top center */
@media only screen and (max-device-width: 500px) {
  .theme-toggle {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}

/* Tablet positioning */
@media only screen and (min-device-width: 501px) and (max-device-width: 1024px) {
  .theme-toggle {
    top: 15px;
    right: 15px;
  }
}

/* Ensure toggle button is above other content */
.theme-toggle {
  position: fixed !important;
}

/* Prevent text selection on double-click */
.theme-toggle::selection {
  background: transparent;
}

.theme-toggle::-moz-selection {
  background: transparent;
}
