/**
 * Checkbox Component - Custom checkbox with theme colors and smooth animations
 */

.custom-checkbox {
    /* Reset default appearance */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    /* Base styles */
    cursor: pointer;
    display: inline-block;
    position: relative;
    margin: 0;

    /* Border only, no background */
    background: transparent;
    border: 1.5px solid var(--border-default);
    border-radius: 4px;

    /* Smooth transitions - butter smooth */
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

/* Size variants */
.custom-checkbox.checkbox-small {
    width: 14px;
    height: 14px;
}

.custom-checkbox.checkbox-medium {
    width: 18px;
    height: 18px;
}

.custom-checkbox.checkbox-large {
    width: 22px;
    height: 22px;
}

/* Hover state */
.custom-checkbox:hover:not(:disabled) {
    border-color: var(--blue-primary);
}

/* Checked state */
.custom-checkbox:checked {
    border-color: var(--border-default); /* Keep default border, don't highlight */
    background: transparent; /* Keep transparent, no bg fill */
}

/* Neutral variant */
.custom-checkbox.checkbox-neutral:checked {
    border-color: var(--border-default); /* Keep default border */
}

.custom-checkbox.checkbox-neutral:hover:not(:disabled) {
    border-color: var(--text-secondary);
}

/* Checkmark - clean and elegant */
.custom-checkbox:checked::after {
    content: '';
    position: absolute;
    display: block;

    /* Checkmark shape using borders */
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid var(--blue-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);

    /* Smooth scale-in animation */
    animation: checkmark-in 0.2s ease forwards;
}

/* Neutral variant checkmark */
.custom-checkbox.checkbox-neutral:checked::after {
    border-color: var(--text-secondary);
}

/* Small size checkmark adjustments */
.custom-checkbox.checkbox-small:checked::after {
    left: 4px;
    top: 1px;
    width: 3px;
    height: 6px;
    border-width: 0 1.5px 1.5px 0;
}

/* Large size checkmark adjustments */
.custom-checkbox.checkbox-large:checked::after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border-width: 0 2.5px 2.5px 0;
}

/* Disabled state */
.custom-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.4;
    border-color: var(--border-subtle);
}

/* Focus state - subtle ring */
.custom-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* Checkmark animation - scale in smoothly */
@keyframes checkmark-in {
    0% {
        transform: rotate(45deg) scale(0);
        opacity: 0;
    }
    50% {
        transform: rotate(45deg) scale(1.1);
    }
    100% {
        transform: rotate(45deg) scale(1);
        opacity: 1;
    }
}
