/* /static/css/theme-switcher.css — compact sun/moon toggle button */
.theme-switcher {
    display: flex;
}

.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;

    -webkit-touch-callout: none;
}

.theme-switcher__toggle-button {
    display: flex;
    position: relative;
    padding: 0;
    width: 40px;
    height: 40px;

    align-items: center;
    justify-content: center;

    border-color: transparent;
    border-radius: 50%;

    background: transparent;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    cursor: pointer;

    -webkit-tap-highlight-color: transparent;

    transition: border-color 0.5s ease, background-color 0.5s ease, color 0.5s ease, transform 0.5s ease;
    overflow: hidden;
}

.theme-switcher__toggle-button:hover {
    background-color: var(--bg-button-hover);
}

.theme-switcher__toggle-button:active {
    transform: scale(0.95);
}

.theme-switcher__toggle-button .icon {
    width: 27px;
    height: 27px;
    position: absolute;
    transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                opacity 0.5s ease;
}

/* Sun icon (visible in light mode) */
.sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    fill: #fbbf24;
    stroke: #fbbf24;
    transition: transform 0.6s, opacity 0.5s, fill 0.25s, stroke 0.25s;
}

/* Moon icon (hidden by default) */
.moon-icon {
    opacity: 0;
    transform: rotate(120deg) scale(0.7);
    fill: #fbbf24;
}

/* Dark mode: hide sun, show moon with correct crescent orientation */
.dark .theme-switcher__toggle-button .sun-icon {
    opacity: 0;
    transform: rotate(-120deg) scale(0.7);
}

.dark .theme-switcher__toggle-button .moon-icon {
    opacity: 1;
    transform: rotate(-100deg) scale(1); /* perfect crescent moon orientation */
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .theme-switcher {
        top: 12px;
        right: 12px;
    }
    .theme-switcher__toggle-button {
        width: 30px;
        height: 30px;
    }
    .theme-switcher__toggle-button .icon {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    .theme-switcher__toggle-button {
        width: 30px;
        height: 30px;
    }
    .theme-switcher__toggle-button .icon {
        width: 22px;
        height: 22px;
    }
}

@media (hover: none) and (pointer: coarse) {
  .theme-switcher__toggle-button {
    border: none;
    background-color: transparent !important;
  }
}
