/* Ensure form inside modal-content is flex column and allows scrolling */
.modal-content form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

/* Modal Overlay */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

/* Modal Container */
.modal-container {
  background: white;
  border-radius: 8px;
  max-width: 800px;
  width: 90%;
  height: 90vh;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* Modal Content */
.modal-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

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

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #111827;
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
  flex-shrink: 0;
}

.modal-close:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1.5rem;
}

.modal-description {
  margin: 0 0 1.5rem 0;
  color: #6b7280;
  font-size: 0.95rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.5rem;
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
}

/* Status Fields List */
.status-fields-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.status-fields-list .field-item {
  background: #f9fafb;
  padding: 1rem;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  min-width: 0;
}

.status-fields-list .field-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.status-fields-list .field-label {
  font-weight: 600;
  color: #111827;
  font-size: 0.95rem;
  display: block;
}

.status-fields-list .field-required {
  background-color: #fef2f2;
  color: #991b1b;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-fields-list .field-description {
  color: #6b7280;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.status-fields-list .field-input,
.status-fields-list .field-textarea,
.status-fields-list .field-select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.95rem;
}

.status-fields-list .field-textarea {
  min-height: 80px;
  max-height: 200px;
  resize: vertical;
}

.status-fields-list .field-radio-group,
.status-fields-list .field-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.status-fields-list .field-radio-item,
.status-fields-list .field-checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-fields-list .field-radio-item input,
.status-fields-list .field-checkbox-item input {
  cursor: pointer;
}

.status-fields-list .field-radio-item label,
.status-fields-list .field-checkbox-item label {
  cursor: pointer;
  margin: 0;
}

.status-fields-list .current-file {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background-color: #f3f4f6;
  border-radius: 4px;
  font-size: 0.875rem;
  color: #4b5563;
}