/**
 * Configuration modal – matches csm-ui. Literal values only.
 */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
}

.close-button {
  background: none;
  border: none;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.close-button:hover {
  background-color: #f5f5f5;
}

.modal-description {
  padding: 24px;
  color: #666;
  font-size: 14px;
  border-bottom: 1px solid #e5e7eb;
}

.form-section {
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
  position: relative;
  z-index: 1;
  overflow: visible;
}

.practice-select-container {
  position: relative;
  z-index: 100;
  overflow: visible;
}

.form-section:last-of-type {
  border-bottom: none;
}

.form-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 16px;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #1a1a1a;
  cursor: pointer;
}

.threshold-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.threshold-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.threshold-item label {
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
}

.input-with-unit {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
}

.input-with-unit input {
  flex: 1;
  padding: 10px 12px;
  border: none;
  font-size: 14px;
}

.input-with-unit input:focus {
  outline: none;
}

.input-with-unit .unit {
  padding: 10px 12px;
  background-color: #f5f5f5;
  font-size: 14px;
  color: #666;
  border-left: 1px solid #ddd;
}

.practice-select {
  width: 100%;
  padding: 10px 12px;
  padding-right: 40px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
  position: relative;
  z-index: 100;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

.practice-select:focus {
  outline: none;
  border-color: #1a1a1a;
  z-index: 101;
}

.practice-selection-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.select-all-button,
.deselect-all-button {
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 12px;
  background: #fff;
  color: #1a1a1a;
  cursor: pointer;
}

.select-all-button:hover,
.deselect-all-button:hover {
  background-color: #f5f5f5;
}

.practice-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 8px;
  background: #fafafa;
}

.practice-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
}

.practice-checkbox-label:hover {
  background-color: #f5f5f5;
}

.threshold-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.watch-dot {
  background-color: #f59e0b;
}

.flagged-dot {
  background-color: #ef4444;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 24px;
  border-top: 1px solid #e5e7eb;
}

.cancel-button,
.save-button {
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
}

.cancel-button {
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #ddd;
}

.cancel-button:hover {
  background-color: #f5f5f5;
}

.save-button {
  background: #1a1a1a;
  color: #fff;
}

.save-button:hover {
  background: #333;
}
