/*
 * Professional Switch Toggle Styles
 * Compatible with system color palette
 * Responsive and accessible design
 */

/* Switch Container */
.switch-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

/* Switch Base */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

/* Hide default checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* Switch Slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #E74C3C; /* System red color */
    transition: .4s;
    border-radius: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Switch Button */
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Checked State */
input:checked + .slider {
    background-color: #00C49D; /* System green color */
    box-shadow: 0 0 8px rgba(0, 196, 157, 0.3);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Hover Effects */
.slider:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

input:checked + .slider:hover {
    box-shadow: 0 0 12px rgba(0, 196, 157, 0.4);
}

/* Label Styling */
.switch-label {
    font-weight: 600;
    color: #2C3E50;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Accessibility - Focus States */
.switch input:focus + .slider {
    outline: 2px solid #3498DB;
    outline-offset: 2px;
}

/* Disabled State */
.switch input:disabled + .slider {
    background-color: #BDC3C7;
    cursor: not-allowed;
}

.switch input:disabled + .slider:before {
    background-color: #ECF0F1;
}

/* Smooth Animations */
.slider, .slider:before {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .switch-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .switch {
        width: 45px;
        height: 22px;
    }

    .slider:before {
        height: 16px;
        width: 16px;
        left: 3px;
        bottom: 3px;
    }

    input:checked + .slider:before {
        transform: translateX(23px);
    }
}

/* Large Switch Variant */
.switch-large {
    width: 60px;
    height: 30px;
}

.switch-large .slider:before {
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
}

.switch-large input:checked + .slider:before {
    transform: translateX(30px);
}

/* Small Switch Variant */
.switch-small {
    width: 40px;
    height: 20px;
}

.switch-small .slider:before {
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
}

.switch-small input:checked + .slider:before {
    transform: translateX(20px);
}

/* Alternative Color Schemes */
.switch-primary input:checked + .slider {
    background-color: #3498DB;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.3);
}

.switch-warning input:checked + .slider {
    background-color: #F1C232;
    box-shadow: 0 0 8px rgba(241, 194, 50, 0.3);
}

.switch-info input:checked + .slider {
    background-color: #23A6D5;
    box-shadow: 0 0 8px rgba(35, 166, 213, 0.3);
}

/* Dark Theme Support */
.dark-theme .switch-label {
    color: #ECF0F1;
}

.dark-theme .slider {
    background-color: #7F8C8D;
}

.dark-theme input:checked + .slider {
    background-color: #00C49D;
}

/* Animation for page load */
@keyframes switchSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.switch-container {
    animation: switchSlideIn 0.3s ease-out;
}
