/* Toggle Switch Styles */
/* Modern toggle switch component that works without Tailwind peer classes */

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e7eb; /* gray-200 */
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #9333ea; /* purple-600 */
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 4px rgba(147, 51, 234, 0.3); /* purple-300 with opacity */
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Disabled state */
.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Hover effect */
.toggle-slider:hover {
    background-color: #d1d5db; /* gray-300 */
}

.toggle-switch input:checked + .toggle-slider:hover {
    background-color: #7c3aed; /* purple-700 */
}

/* Different color variants */
.toggle-switch.toggle-green input:checked + .toggle-slider {
    background-color: #10b981; /* green-500 */
}

.toggle-switch.toggle-green input:focus + .toggle-slider {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.3);
}

.toggle-switch.toggle-blue input:checked + .toggle-slider {
    background-color: #3b82f6; /* blue-500 */
}

.toggle-switch.toggle-blue input:focus + .toggle-slider {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3);
}

.toggle-switch.toggle-red input:checked + .toggle-slider {
    background-color: #ef4444; /* red-500 */
}

.toggle-switch.toggle-red input:focus + .toggle-slider {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.3);
}

/* Larger size */
.toggle-switch.toggle-lg {
    width: 52px;
    height: 28px;
}

.toggle-switch.toggle-lg .toggle-slider:before {
    height: 24px;
    width: 24px;
}

.toggle-switch.toggle-lg input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Smaller size */
.toggle-switch.toggle-sm {
    width: 36px;
    height: 20px;
}

.toggle-switch.toggle-sm .toggle-slider:before {
    height: 16px;
    width: 16px;
}

.toggle-switch.toggle-sm input:checked + .toggle-slider:before {
    transform: translateX(16px);
}
