/* Checkbox Group Component Styles */
/* Based on Figma design specifications */

.checkbox-group-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 380px;
    font-family: 'Noto Sans JP', sans-serif;
    border: 1px solid #FF008C;
    border-radius: 8px;
    padding: 24px;
    background-color: #FFFFFF;
    box-sizing: border-box;
    margin-top: 15px;
}

/* Checkbox items container */
.checkbox-group-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Individual checkbox item */
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

/* Hide default checkbox */
.checkbox-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Custom checkbox */
.checkbox-item .checkbox-custom {
    position: relative;
    width: 21.83px;
    height: 21.83px;
    min-width: 21.83px;
    min-height: 21.83px;
    background-color: #FFFFFF;
    border: 1px solid #666666;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    pointer-events: none; /* Disable direct clicks on the custom checkbox */
}

/* Checkbox checked state */
.checkbox-item input[type="checkbox"]:checked + .checkbox-custom {
    background-color: #FF008C;
    border-color: #FF008C;
}

/* Checkmark */
.checkbox-item input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 5px;
    height: 10px;
    border: solid #FFFFFF;
    border-width: 0 1px 1px 0;
}

/* Checkbox label */
.checkbox-item label {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: #333333;
    cursor: pointer;
    user-select: none;
    flex: 1;
}

/* Make label cover the custom checkbox area for better clickability */
.checkbox-item label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 21.83px;
    height: 21.83px;
    cursor: pointer;
}

/* Hover state */
.checkbox-item:hover .checkbox-custom {
    border-color: #FF008C;
}

/* Focus state for accessibility */
/* .checkbox-item input[type="checkbox"]:focus + .checkbox-custom {
    outline: 2px solid #FF008C;
    outline-offset: 2px;
} */

/* Disabled state */
.checkbox-item input[type="checkbox"]:disabled + .checkbox-custom {
    background-color: #CECED2;
    border-color: #666666;
    cursor: not-allowed;
}

.checkbox-item input[type="checkbox"]:disabled ~ label {
    color: #828282;
    cursor: not-allowed;
}

/* Disabled state - CHECKED */
.checkbox-item input[type="checkbox"]:disabled:checked + .checkbox-custom {
    background-color: #828282;
    border-color: #666666;
}

.checkbox-item input[type="checkbox"]:disabled:checked + .checkbox-custom::after {
    border-color: #FFFFFF;
}

.checkbox-item input[type="checkbox"]:disabled:checked ~ label {
    color: #333333;
}

/* Container disabled state */
.checkbox-group-container.disabled {
    pointer-events: none;
    opacity: 1;
}

/* Unchecked disabled items */
.checkbox-group-container.disabled .checkbox-custom {
    background-color: #CECED2;
    border-color: #666666;
}

.checkbox-group-container.disabled .checkbox-item label {
    color: #828282;
}

/* Checked disabled items */
.checkbox-group-container.disabled .checkbox-item input[type="checkbox"]:checked + .checkbox-custom {
    background-color: #828282;
    border-color: #666666;
}

.checkbox-group-container.disabled .checkbox-item input[type="checkbox"]:checked + .checkbox-custom::after {
    border-color: #FFFFFF;
}

.checkbox-group-container.disabled .checkbox-item input[type="checkbox"]:checked ~ label {
    color: #333333;
}

.checkbox-group-container.disabled .checkbox-group-button {
    background-color: #CECED2;
    color: #717171;
    cursor: not-allowed;
}

.checkbox-group-container.disabled .checkbox-group-button--secondary {
    border: none;
    font-weight: 500;
}

.checkbox-group-container.disabled .checkbox-group-button--primary,
.checkbox-group-container.disabled .checkbox-group-button--primary-disabled {
    border-color: #666666;
}

/* Button container */
.checkbox-group-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

/* Button base styles */
.checkbox-group-button {
    font-family: 'Rakuten Sans JP', 'Noto Sans JP', sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    padding: 8px 16px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-align: center;
    white-space: nowrap;
    box-sizing: border-box;
    flex: 1 0 auto;
    max-width: calc(100% - 12px);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

/* Secondary button (View All Campaigns) */
.checkbox-group-button--secondary {
    background-color: #FFFFFF;
    color: #595959;
    border: 1px solid #717171;
    box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

.checkbox-group-button--secondary:hover {
    background-color: #F9F9F9;
    border-color: #595959;
}

.checkbox-group-button--secondary:active {
    box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.1);
    transform: translateY(1px);
}

/* Primary button disabled (Submit) */
.checkbox-group-button--primary-disabled {
    background-color: #CECED2;
    color: #717171;
    font-weight: 500;
    cursor: not-allowed;
}

.checkbox-group-button--primary-disabled:hover {
    background-color: #CECED2;
}

/* Primary button enabled */
.checkbox-group-button--primary {
    background-color: #FF008C;
    color: #FFFFFF;
    font-weight: 500;
}

.checkbox-group-button--primary:hover {
    background-color: #E6007A;
}

.checkbox-group-button--primary:active {
    background-color: #CC006D;
    transform: translateY(1px);
}
