.theme-toggle {
    display: inline-flex;
    align-items: center;
}

[x-cloak] {
    display: none !important;
}

.theme-button {
    width: 52px;
    height: 28px;
    background: #e2e8f0 !important;
    border: 2px solid #cbd5e1 !important;
    border-radius: 24px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    flex-shrink: 0;
    padding: 0 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.theme-button:hover {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.theme-dark {
    background: #312e81 !important;
    border-color: #4338ca !important;
}

.theme-dark:hover {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

.theme-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.theme-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

html.dark .theme-knob {
    transform: translateX(24px);
}

.theme-button:hover .theme-knob {
    box-shadow: 0 1px 6px rgba(99, 102, 241, 0.3);
}

.theme-icon {
    font-size: 10px;
    line-height: 1;
    position: absolute;
    transition: opacity 0.3s;
}

.theme-icon.fa-sun {
    color: #f59e0b;
}

.theme-icon.fa-moon {
    color: #6366f1;
}

html.dark .theme-icon.fa-sun {
    opacity: 0;
}

.theme-icon.fa-sun {
    opacity: 1;
}

html.dark .theme-icon.fa-moon {
    opacity: 1;
}

.theme-icon.fa-moon {
    opacity: 0;
}