/* Preferences dialog specific styles */
.preferences-modal .modal-content {
  min-width: 350px;
}

/* Checkbox styling */
.checkbox-container {
  display: block;
  position: relative;
  padding-left: 30px;
  margin-bottom: 16px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
  user-select: none;
  transition: color 0.2s ease;
}

.checkbox-container:hover {
  color: var(--primary-color);
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 2px;
  left: 0;
  height: 18px;
  width: 18px;
  background-color: var(--surface-color);
  border: 2px solid var(--border-color);
  border-radius: 3px;
  transition: all 0.2s ease;
}

.checkbox-container:hover input ~ .checkmark {
  border-color: var(--primary-color);
  background-color: var(--bg-color);
}

.checkbox-container input:checked ~ .checkmark {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
  display: block;
}

.checkbox-container .checkmark:after {
  left: 5px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Preferences section styling */
.preferences-section {
  margin-bottom: 24px;
}

.preferences-section:last-child {
  margin-bottom: 0;
}

.preferences-section h3 {
  font-size: 14px;
  font-weight: normal;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  color: var(--primary-color);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
}

/* Preference item descriptions */
.preference-description {
  font-size: 12px;
  color: var(--secondary-color);
  margin-top: 4px;
  margin-left: 30px;
  line-height: 1.3;
}

/* Toggle switch alternative styling (unused but available) */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
  margin-right: 10px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: 0.3s;
  border-radius: 20px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* Slider styling */
.preference-section {
  margin-bottom: 20px;
}

.preference-section label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--primary-color);
}

#grid-size-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border-color);
  outline: none;
  margin: 8px 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

#grid-size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  transition: background 0.2s ease;
}

#grid-size-slider::-webkit-slider-thumb:hover {
  background: #555;
}

#grid-size-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: none;
}

#grid-size-value {
  font-weight: bold;
  color: var(--primary-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .preferences-modal .modal-content {
    min-width: 280px;
    margin: 20px;
  }
  
  .checkbox-container {
    font-size: 13px;
    padding-left: 28px;
    margin-bottom: 14px;
  }
  
  .checkmark {
    height: 16px;
    width: 16px;
    top: 1px;
  }
  
  .checkbox-container .checkmark:after {
    left: 4px;
    top: 0px;
    width: 3px;
    height: 7px;
  }
  
  .preference-description {
    font-size: 11px;
    margin-left: 28px;
  }
}

/* Dark mode support (for future enhancement) */
@media (prefers-color-scheme: dark) {
  :root {
    --primary-color: #e0e0e0;
    --secondary-color: #b0b0b0;
    --bg-color: #1a1a1a;
    --surface-color: #2d2d2d;
    --border-color: #404040;
  }
}
