/* Calculated Fields Modal Styles */

.calculated-section {
  margin-bottom: 20px;
  padding: 15px;
  border-radius: 8px;
  background-color: #f9f9f9;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.section-title {
  color: #0072a0;
  font-weight: 600;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
}

.section-icon {
  margin-right: 10px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
}

.field-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.field-input:focus {
  border-color: #0072a0;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 114, 160, 0.2);
}

.field-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.field-tag {
  display: inline-flex;
  align-items: center;
  background-color: #e3f2fd;
  border: 1px solid #bbdefb;
  border-radius: 20px;
  padding: 6px 12px;
  margin: 4px;
  font-size: 13px;
  font-family: monospace;
  cursor: pointer;
  transition: all 0.2s;
}

.field-tag:hover {
  background-color: #bbdefb;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.field-icon {
  margin-right: 5px;
  color: #1976d2;
}

.equation-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: monospace;
  font-size: 14px;
  margin-bottom: 8px;
}

.equation-hint {
  display: block;
  margin-bottom: 15px;
  color: #666;
  font-style: italic;
}

.operators-container,
.fields-container,
.constants-container,
.new-constant-container {
  margin-bottom: 20px;
}

.subsection-title {
  color: #555;
  font-weight: 500;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

.subsection-icon {
  margin-right: 8px;
  color: #0072a0;
}

.operator-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.operator-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #0072a0;
  color: white;
  border: 1px solid #005a80;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 14px;
  font-family: monospace;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 36px;
}

.operator-tag:hover {
  background-color: #005a80;
  transform: scale(1.1);
}

.field-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.constant-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.constant-tag {
  display: inline-flex;
  align-items: center;
  background-color: #4caf50;
  color: white;
  border: 1px solid #388e3c;
  border-radius: 20px;
  padding: 6px 12px;
  margin: 4px;
  font-size: 13px;
  font-family: monospace;
  cursor: pointer;
  transition: all 0.2s;
}

.constant-tag:hover {
  background-color: #388e3c;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.constant-icon {
  margin-right: 5px;
}

.add-constant-btn {
  background-color: #ff9800;
  border-color: #f57c00;
}

.add-constant-btn:hover {
  background-color: #f57c00;
}

.field-components-container {
  background-color: white;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 15px;
}

.field-component-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
}

.field-select-container,
.constant-input-container {
  flex: 1;
}

.field-select,
.constant-input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.remove-field-btn {
  padding: 6px;
}

.add-field-btn {
  margin-top: 10px;
  background-color: #1976d2;
  border-color: #1976d2;
  color: white;
}

.add-field-btn:hover {
  background-color: #1565c0;
}

.created-fields-section {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.table-container {
  overflow-x: auto;
}

.calculated-fields-table {
  width: 100%;
  border-collapse: collapse;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border-radius: 6px;
  overflow: hidden;
}

.calculated-fields-table th {
  background-color: #f5f5f5;
  padding: 12px 15px;
  text-align: left;
  font-weight: 600;
  color: #333;
}

.calculated-fields-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #eee;
}

.field-name-cell {
  font-weight: 500;
  color: #0072a0;
}

.operation-cell {
  font-family: monospace;
  background-color: #e3f2fd;
  border-radius: 4px;
  padding: 4px 8px;
  display: inline-block;
}

.expression-cell {
  font-family: monospace;
  font-size: 13px;
}

.actions-cell {
  text-align: center;
}

.delete-field-btn {
  padding: 6px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .field-component-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .field-select-container,
  .constant-input-container {
    margin-bottom: 8px;
  }
}