/* Toggles.css - Modern Toggle Switch Styles for Checkboxes */

/* Base Toggle Switch Styles */
.toggle,
input[type="checkbox"].toggle {
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 50px;
    height: 30px;
    background-color: #e0e0e0;
    border-radius: 15px;
    outline: none;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    flex-shrink: 0;
    border: 2px solid transparent;
    margin: 0;
    padding: 0;
}

/* Toggle Switch Slider (::before pseudo-element) */
.toggle::before,
input[type="checkbox"].toggle::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #ffffff;
    top: 4px;
    left: 4px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Checked State */
.toggle:checked,
input[type="checkbox"].toggle:checked {
    background-color: #20b2aa;
    border-color: #20b2aa;
}

.toggle:checked::before,
input[type="checkbox"].toggle:checked::before {
    transform: translateX(20px);
    background-color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Hover States */
.toggle:hover:not(:disabled),
input[type="checkbox"].toggle:hover:not(:disabled) {
    background-color: #d0d0d0;
}

.toggle:checked:hover:not(:disabled),
input[type="checkbox"].toggle:checked:hover:not(:disabled) {
    background-color: #1da39a;
    border-color: #1da39a;
}

/* Focus States */
.toggle:focus,
input[type="checkbox"].toggle:focus {
    outline: 2px solid rgba(32, 178, 170, 0.4);
    outline-offset: 2px;
}

.toggle:checked:focus,
input[type="checkbox"].toggle:checked:focus {
    outline-color: rgba(29, 163, 154, 0.4);
}

/* Disabled State */
.toggle:disabled,
input[type="checkbox"].toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

.toggle:disabled::before,
input[type="checkbox"].toggle:disabled::before {
    background-color: #e0e0e0;
}

/* Toggle Container - For labels wrapping toggles */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.toggle-container .toggle-label {
    flex: 1;
    cursor: pointer;
}

.toggle-container .toggle-label strong {
    display: block;
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 2px;
    font-weight: 600;
}

.toggle-container .toggle-label small {
    font-size: 12px;
    color: #6b7280;
    display: block;
}

/* Toggle Sizes */
.toggle-sm,
input[type="checkbox"].toggle-sm {
    width: 40px;
    height: 24px;
    border-radius: 12px;
}

.toggle-sm::before,
input[type="checkbox"].toggle-sm::before {
    width: 18px;
    height: 18px;
    top: 3px;
    left: 3px;
    border-radius: 50%;
}

.toggle-sm:checked::before,
input[type="checkbox"].toggle-sm:checked::before {
    transform: translateX(16px);
}

.toggle-lg,
input[type="checkbox"].toggle-lg {
    width: 60px;
    height: 36px;
    border-radius: 18px;
}

.toggle-lg::before,
input[type="checkbox"].toggle-lg::before {
    width: 26px;
    height: 26px;
    top: 5px;
    left: 5px;
    border-radius: 50%;
}

.toggle-lg:checked::before,
input[type="checkbox"].toggle-lg:checked::before {
    transform: translateX(24px);
}

/* Toggle Colors */
.toggle-primary:checked,
input[type="checkbox"].toggle-primary:checked {
    background-color: #007cba;
    border-color: #007cba;
}

.toggle-success:checked,
input[type="checkbox"].toggle-success:checked {
    background-color: #28a745;
    border-color: #28a745;
}

.toggle-warning:checked,
input[type="checkbox"].toggle-warning:checked {
    background-color: #ffc107;
    border-color: #ffc107;
}

.toggle-danger:checked,
input[type="checkbox"].toggle-danger:checked {
    background-color: #dc3545;
    border-color: #dc3545;
}

.toggle-info:checked,
input[type="checkbox"].toggle-info:checked {
    background-color: #17a2b8;
    border-color: #17a2b8;
}

/* Apply toggle class to all checkboxes by default */
input[type="checkbox"] {
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 50px;
    height: 30px;
    background-color: #e0e0e0;
    border-radius: 15px;
    outline: none;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    flex-shrink: 0;
    border: 2px solid transparent;
    margin: 0;
    padding: 0;
}

input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #ffffff;
    top: 4px;
    left: 4px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input[type="checkbox"]:checked {
    background-color: #20b2aa;
    border-color: #20b2aa;
}

input[type="checkbox"]:checked::before {
    transform: translateX(20px);
    background-color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

input[type="checkbox"]:hover:not(:disabled) {
    background-color: #d0d0d0;
}

input[type="checkbox"]:checked:hover:not(:disabled) {
    background-color: #1da39a;
    border-color: #1da39a;
}

input[type="checkbox"]:focus {
    outline: 2px solid rgba(32, 178, 170, 0.4);
    outline-offset: 2px;
}

input[type="checkbox"]:checked:focus {
    outline-color: rgba(29, 163, 154, 0.4);
}

input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

input[type="checkbox"]:disabled::before {
    background-color: #e0e0e0;
}

/* Special cases for checkboxes in tables */
.sd-amp-product-checkbox input[type="checkbox"],
.sd-amp-product-table th input[type="checkbox"] {
    margin: 0 auto;
}

/* Checkbox labels with toggle styling */
.sd-amp-checkbox-label input[type="checkbox"],
.sd-amp-checkbox-label-inline input[type="checkbox"] {
    margin: 0;
}

/* Campaign visibility toggle specific styles */
.sd-amp-campaign-visibility-toggle input[type="checkbox"] {
    width: 50px;
    height: 30px;
    border-radius: 15px;
}

.sd-amp-campaign-visibility-toggle input[type="checkbox"]::before {
    width: 22px;
    height: 22px;
    top: 4px;
    left: 4px;
    border-radius: 50%;
}

.sd-amp-campaign-visibility-toggle input[type="checkbox"]:checked::before {
    transform: translateX(20px);
}

