/* Checkbox Styles for Theme */

/* Ensure the form has a reasonable width/layout */
.ac-custom {
    padding: 0 10px;
    margin: 0 auto;
    max-width: 100%;
}

/* Custom List Item Styling */
.ac-custom ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px; /* Replaces margin-bottom on li */
}

.ac-custom li {
    position: relative;
    margin: 0;
    padding: 0;
    width: 100%;
}

/* Hide default checkbox/radio completely but keep it accessible if needed */
.ac-custom input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    margin: 0;
    z-index: 2; /* Put above label for interaction, or use label for interaction */
}

/* Label Styling - This is the visible button */
.ac-custom label {
    display: flex;
    align-items: center; /* Vertically center items */
    justify-content: flex-start; /* Left align content */
    padding: 15px 20px;
    background: #FFFFFF;
    border: 2px solid #E0E0E0; /* Visible border by default */
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    color: #333;
    font-weight: 500;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    text-align: left; /* Ensure text aligns left */
}

/* Hover Effect */
.ac-custom label:hover {
    background: #F8F9FA;
    border-color: #BDBDBD;
}

/* Checked State - Targets label when input is checked */
.ac-custom input[type="checkbox"]:checked + label {
    background: #F3F0FF !important; /* Force background */
    border-color: #7B61FF !important; /* Force border */
    color: #7B61FF !important; /* Force text color */
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(123, 97, 255, 0.2);
}

/* Checkmark Icon Container (Pseudo-element) */
.ac-custom label::before {
    content: '';
    display: inline-block;
    width: 24px; /* Slightly larger */
    height: 24px;
    margin-right: 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0; /* Prevent shrinking */
    background-color: #fff;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 0; /* Hidden checkmark initially */
}

/* Checked Checkmark Icon */
.ac-custom input[type="checkbox"]:checked + label::before {
    background-color: #7B61FF;
    border-color: #7B61FF;
    background-size: 16px; /* Show checkmark */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white' width='24px' height='24px'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
}

/* Hide SVG from old implementation if present */
.ac-custom svg {
    display: none !important;
}

/* Responsive adjustments */
@media screen and (max-width: 500px) {
    .ac-custom label {
        padding: 12px 15px;
        font-size: 15px;
    }
}
