/* Global Configuration Modal Styles - Matching Preferences Dialog */

.configuration-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.configuration-modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modal content styled like Preferences */
.configuration-modal-content {
  max-width: 900px;
  width: 95%;
  max-height: 95vh;
  background: white;
  border-radius: 12px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Header matching Preferences style */
.configuration-header {
  background: white;
  border-bottom: 1px solid #e1e5e9;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.configuration-header h2 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
  color: #2d3748;
}

.configuration-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #718096;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.configuration-close:hover {
  background: #f7fafc;
  color: #2d3748;
}

/* Tab navigation matching Preferences */
.configuration-tabs {
  display: flex;
  background: #f8f9fa;
  border-bottom: 1px solid #e2e8f0;
  margin: 0;
  padding: 0 2rem;
}

.configuration-tab {
  flex: 1;
  padding: 1rem 1.5rem;
  background: transparent;
  border: none;
  color: #718096;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 0.875rem;
  border-bottom: 3px solid transparent;
  position: relative;
}

.configuration-tab:hover {
  color: #4a5568;
}

.configuration-tab.active {
  color: #3182ce;
  border-bottom-color: #3182ce;
  background: white;
}

.configuration-tab-content {
  display: none;
  padding: 2rem;
  overflow-y: auto;
  flex: 1;
}

.configuration-tab-content.active {
  display: block;
}

/* Configuration Sections - Preferences Style */
.configuration-section {
  margin-bottom: 2rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  background: #f8f9fa;
}

.configuration-section h3 {
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #2d3748;
}

.configuration-description {
  color: #718096;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  font-size: 0.875rem;
}

/* Form Elements - Preferences Style */
.configuration-field {
  margin-bottom: 1.5rem;
}

.configuration-field label {
  display: block;
  color: #4a5568;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
}

.configuration-field textarea {
  width: 100%;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.75rem;
  color: #2d3748;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 120px;
  transition: border-color 0.2s ease;
}

.configuration-field textarea:focus {
  outline: none;
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.configuration-field input[type="number"] {
  width: 120px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  color: #2d3748;
  font-size: 0.875rem;
  transition: border-color 0.2s ease;
}

.configuration-field input[type="number"]:focus {
  outline: none;
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0.75rem 0;
}

.form-row:last-child {
  margin-bottom: 0;
}

.form-row label {
  font-weight: 500;
  color: #4a5568;
  margin-right: 1rem;
  margin-bottom: 0;
}

.configuration-field input[type="range"] {
  min-width: 200px;
  border: none;
  background: transparent;
  cursor: pointer;
  margin-right: 0.75rem;
}

.range-value,
#temperature-value {
  min-width: 50px;
  text-align: right;
  font-weight: 600;
  color: #3182ce;
  background: #ebf8ff;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.875rem;
}

/* Field Mapping Styles - Preferences Style */
.field-mapping-container {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1rem;
}

.field-mapping-header {
  display: grid;
  grid-template-columns: 1fr 2fr 120px;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-weight: 600;
  color: #2d3748;
  font-size: 0.875rem;
}

.field-category-header {
  margin: 1.5rem 0 0.75rem 0;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.5rem;
}

.field-category-header h4 {
  color: #3182ce;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.field-mapping-list {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.field-mapping-row {
  display: grid;
  grid-template-columns: 1fr 2fr 120px;
  gap: 1rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  align-items: center;
  transition: all 0.2s ease;
}

.field-mapping-row:hover {
  background: #f8f9fa;
  border-color: #cbd5e0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.field-mapping-row input {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  color: #2d3748;
  font-size: 0.875rem;
  transition: border-color 0.2s ease;
}

.field-mapping-row input:focus {
  outline: none;
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.field-mapping-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.field-mapping-actions button {
  background: white;
  border: 1px solid #e2e8f0;
  color: #4a5568;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.75rem;
  font-weight: 500;
}

.field-mapping-actions button:hover {
  background: #f8f9fa;
  border-color: #cbd5e0;
}

.field-mapping-actions button.delete {
  border-color: #fc8181;
  color: #c53030;
}

.field-mapping-actions button.delete:hover {
  background: #fed7d7;
  border-color: #f56565;
}

/* Buttons - Preferences Style */
.configuration-btn {
  background: #3182ce;
  border: none;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.configuration-btn:hover {
  background: #2c5aa0;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(49, 130, 206, 0.3);
}

.configuration-btn-secondary {
  background: #e2e8f0;
  color: #4a5568;
  border: 1px solid #cbd5e0;
}

.configuration-btn-secondary:hover {
  background: #cbd5e0;
  color: #2d3748;
}

/* Footer with buttons */
.configuration-footer {
  background: white;
  border-top: 1px solid #e2e8f0;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.configuration-footer-left {
  display: flex;
  gap: 0.75rem;
}

.configuration-footer-right {
  display: flex;
  gap: 0.75rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .configuration-modal-content {
    width: 98%;
    margin: 5px;
    max-height: 98vh;
  }
  
  .configuration-header {
    padding: 1rem 1.5rem;
  }
  
  .configuration-header h2 {
    font-size: 1.5rem;
  }
  
  .configuration-tabs {
    flex-direction: column;
    padding: 0 1rem;
  }
  
  .configuration-tab {
    padding: 0.75rem 1rem;
  }
  
  .configuration-tab-content {
    padding: 1.5rem;
  }
  
  .field-mapping-header,
  .field-mapping-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    text-align: center;
  }
  
  .field-mapping-actions {
    justify-content: center;
    margin-top: 0.5rem;
  }
  
  .configuration-section {
    padding: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .configuration-footer {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 1.5rem;
  }
  
  .configuration-footer-left,
  .configuration-footer-right {
    width: 100%;
    justify-content: center;
  }
  
  .configuration-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Scrollbar Styling - Preferences Style */
.field-mapping-list::-webkit-scrollbar,
.configuration-tab-content::-webkit-scrollbar {
  width: 8px;
}

.field-mapping-list::-webkit-scrollbar-track,
.configuration-tab-content::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.field-mapping-list::-webkit-scrollbar-thumb,
.configuration-tab-content::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 4px;
}

.field-mapping-list::-webkit-scrollbar-thumb:hover,
.configuration-tab-content::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}
