* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

header {
  background: rgba(255, 255, 255, 0.95);
  padding: 2rem;
  text-align: center;
  box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

header h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2.5rem;
  color: #4a5568;
}

header p {
  margin: 0;
  font-size: 1.1rem;
  color: #718096;
}

.demo-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.editor-panel, .results-panel {
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  overflow: hidden;
}

.panel-header {
  background: #4a5568;
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.controls {
  display: flex;
  gap: 0.5rem;
}

.btn-small {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.btn-small:hover {
  background: rgba(255,255,255,0.3);
}

.status {
  background: #48bb78;
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
}

#cssEditor {
  width: 100%;
  min-height: 400px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 14px;
  line-height: 1.5;
  border: none;
  padding: 1rem;
  resize: vertical;
}

.CodeMirror {
  height: 400px;
  font-size: 14px;
}

.analysis-tabs {
  display: flex;
  background: #f7fafc;
  border-bottom: 1px solid #e2e8f0;
}

.tab-btn {
  background: none;
  border: none;
  padding: 1rem 1.5rem;
  cursor: pointer;
  font-weight: 500;
  color: #718096;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
}

.tab-btn.active {
  color: #4a5568;
  border-bottom-color: #667eea;
  background: white;
}

.tab-btn:hover:not(.active) {
  background: #edf2f7;
}

.tab-content {
  display: none;
  padding: 1.5rem;
  min-height: 300px;
}

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

.results-area {
  background: #1a202c;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 6px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 14px;
  line-height: 1.6;
  min-height: 200px;
  white-space: pre-wrap;
}

.placeholder {
  color: #a0aec0;
  font-style: italic;
}

.warning {
  color: #f6ad55;
  margin: 0.5rem 0;
}

.error {
  color: #fc8181;
  margin: 0.5rem 0;
}

.success {
  color: #68d391;
  margin: 0.5rem 0;
}

.data-sources {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.source-item {
  background: #f7fafc;
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.source-item h3 {
  margin: 0 0 0.5rem 0;
  color: #4a5568;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.source-status {
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.source-status.loaded {
  background: #c6f6d5;
  color: #2f855a;
}

.source-status.cached {
  background: #bee3f8;
  color: #2b6cb0;
}

.source-details {
  color: #718096;
  font-size: 0.9rem;
}

.workflow-demo {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.workflow-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.step-number {
  background: #667eea;
  color: white;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  flex-shrink: 0;
}

.step-content h3 {
  margin: 0 0 0.5rem 0;
  color: #4a5568;
}

.step-content p {
  margin: 0;
  color: #718096;
  line-height: 1.5;
}

.features-showcase {
  background: rgba(255, 255, 255, 0.95);
  margin: 2rem;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.features-showcase h2 {
  text-align: center;
  color: #4a5568;
  margin-bottom: 2rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: #f7fafc;
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.feature-card h3 {
  margin: 0 0 1rem 0;
  color: #4a5568;
}

.feature-card p {
  margin: 0;
  color: #718096;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .demo-container {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  header {
    padding: 1rem;
  }
  
  header h1 {
    font-size: 2rem;
  }
}
