/**
 * Checkbox Component Styles
 * Household Management App
 */

.custom-checkbox-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.custom-checkbox {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
}

.custom-checkbox__indicator {
  position: relative;
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background-color: var(--bg-secondary);
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.custom-checkbox__indicator::after {
  content: '';
  position: absolute;
  display: none;
  left: 50%;
  top: 50%;
  width: 0.375rem;
  height: 0.625rem;
  border: solid var(--color-primary);
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -60%) rotate(45deg);
}

.custom-checkbox-wrapper--checked .custom-checkbox__indicator {
  border-color: var(--color-primary);
}

.custom-checkbox-wrapper--checked .custom-checkbox__indicator::after {
  display: block;
}

.custom-checkbox-wrapper:hover .custom-checkbox__indicator {
  border-color: var(--color-primary);
}

.custom-checkbox-wrapper:focus-within .custom-checkbox__indicator {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Sizes */
.custom-checkbox--small + .custom-checkbox__indicator {
  width: 1rem;
  height: 1rem;
}

.custom-checkbox--small + .custom-checkbox__indicator::after {
  width: 0.25rem;
  height: 0.5rem;
}

.custom-checkbox--large + .custom-checkbox__indicator {
  width: 1.5rem;
  height: 1.5rem;
}

.custom-checkbox--large + .custom-checkbox__indicator::after {
  width: 0.5rem;
  height: 0.75rem;
}

/* Disabled state */
.custom-checkbox:disabled + .custom-checkbox__indicator {
  opacity: 0.5;
  cursor: not-allowed;
}

.custom-checkbox-wrapper:has(.custom-checkbox:disabled) {
  cursor: not-allowed;
}

