/* 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;
  }
}

/* Group By Modal Styles */
.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-tag.selected {
  background-color: #1976d2;
  color: white;
  border-color: #1976d2;
}

.selected-fields-container {
  min-height: 50px;
  padding: 10px;
  border: 1px dashed #ccc;
  border-radius: 4px;
  background-color: #f9f9f9;
}

.selected-field-tag {
  display: inline-flex;
  align-items: center;
  background-color: #1976d2;
  color: white;
  border-radius: 20px;
  padding: 6px 12px;
  margin: 4px;
  font-size: 13px;
}

.selected-field-tag .btn-icon {
  margin-left: 8px;
  padding: 2px;
  color: white;
}

.no-selection {
  color: #999;
  font-style: italic;
  padding: 10px;
}

.aggregation-container {
  margin-top: 10px;
}

.aggregation-row {
  background-color: #f5f5f5;
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.aggregation-row label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.clr-select {
  width: 100%;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Data Lake Type Styles */
.clr-subtext {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: #666;
}

[data-multiple] {
  height: auto !important;
  min-height: 80px;
}

/* Checkbox Styles for Blending Data Lakes */
.checkbox-container {
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 10px;
  max-height: 200px;
  overflow-y: auto;
  background-color: #f9f9f9;
}

.checkbox-item {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.checkbox-item input[type="checkbox"] {
  margin-right: 8px;
}

.checkbox-item label {
  margin-bottom: 0;
  cursor: pointer;
}

/* Blending Keys Panel Styles */
.blending-keys-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: white;
  border-top: 1px solid #ccc;
  box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
  z-index: 1000;
  max-height: 50vh;
  overflow-y: auto;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #eee;
  background-color: #f5f5f5;
}

.panel-header h3 {
  margin: 0;
  color: #333;
}

.panel-content {
  padding: 15px;
}

.keys-container {
  margin-bottom: 20px;
  padding: 10px;
  border: 1px solid #eee;
  border-radius: 4px;
  background-color: #fafafa;
}

.keys-container h4 {
  margin-top: 0;
  color: #555;
}

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

.header-tag {
  display: inline-block;
  background-color: #e3f2fd;
  border: 1px solid #bbdefb;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 12px;
  font-family: monospace;
}

.sql-editor-container {
  margin-top: 20px;
}

.sql-textarea {
  width: 100%;
  font-family: 'Courier New', monospace;
  font-size: 14px;
}

.editor-actions {
  margin-top: 10px;
  text-align: right;
}

/* Blending Configuration Modal Styles */
.blending-config-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

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

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

.key-card {
  background-color: white;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.key-header h5 {
  margin: 0 0 10px 0;
  color: #333;
  font-weight: 500;
}

.headers-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.header-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;
}

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

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

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

.sql-textarea {
  width: 100%;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  min-height: 150px;
}

.editor-hint {
  margin-top: 10px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 15px;
  border-top: 1px solid #eee;
}

/* Field Mapping Modal Styles */
.field-mapping-container {
  padding: 10px;
}

.instructions {
  background-color: #e3f2fd;
  border: 1px solid #bbdefb;
  border-radius: 4px;
  padding: 15px;
  margin-bottom: 20px;
}

.instructions p {
  margin: 0;
  color: #1976d2;
}

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

.mapping-table {
  width: 100%;
  border-collapse: collapse;
}

.mapping-table th {
  background-color: #f5f5f5;
  padding: 12px 15px;
  text-align: left;
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #ddd;
}

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

.original-field {
  vertical-align: middle;
}

.field-tag {
  display: inline-block;
  background-color: #e0e0e0;
  border: 1px solid #bdbdbd;
  border-radius: 4px;
  padding: 6px 10px;
  font-family: monospace;
  font-size: 13px;
}

.mapping-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

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

.no-data-message {
  text-align: center;
  padding: 30px;
  color: #666;
  font-style: italic;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 15px;
  border-top: 1px solid #eee;
}

/* Scheduler Modal Styles */
.scheduler-container {
  padding: 10px;
}

.data-lake-info h4 {
  margin: 0 0 20px 0;
  color: #333;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.job-info-section {
  background-color: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
}

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.job-header h5 {
  margin: 0;
  color: #333;
}

.badge {
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
}

.badge-success {
  background-color: #4caf50;
  color: white;
}

.badge-warning {
  background-color: #ff9800;
  color: white;
}

.badge-danger {
  background-color: #f44336;
  color: white;
}

.badge-light {
  background-color: #e0e0e0;
  color: #333;
}

.job-details {
  margin-bottom: 20px;
}

.detail-row {
  display: flex;
  margin-bottom: 10px;
}

.detail-row label {
  font-weight: 500;
  width: 120px;
  color: #555;
}

.detail-row span {
  flex: 1;
}

.job-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.job-actions .btn {
  display: flex;
  align-items: center;
  gap: 5px;
}

.no-job-section {
  text-align: center;
  padding: 30px 20px;
}

.no-job-message p {
  margin: 10px 0;
  color: #666;
}

.no-job-message p:first-child {
  font-size: 18px;
  color: #333;
}

.create-job-actions {
  margin-top: 20px;
}

.create-job-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 15px;
  border-top: 1px solid #eee;
}

/* Webhook Status Styles */
.webhook-enabled {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  background-color: #4caf50;
  color: white;
}

.webhook-disabled {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  background-color: #f44336;
  color: white;
}

/* Webhook Status Styles */
.webhook-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
}

.webhook-status.enabled {
  background-color: #4caf50;
  color: white;
}

.webhook-status.disabled {
  background-color: #f44336;
  color: white;
}

/* Webhook Modal Styles */
.webhook-container {
  padding: 10px;
}

.webhook-container .data-lake-info h4 {
  margin: 0 0 20px 0;
  color: #333;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.webhook-form {
  margin-bottom: 20px;
}

.webhook-info {
  background-color: #e3f2fd;
  border: 1px solid #bbdefb;
  border-radius: 4px;
  padding: 15px;
  margin-top: 20px;
}

.webhook-info p {
  margin: 0;
  color: #1976d2;
}
