/* DatosGob AI Analyzer - Estilos Modernos */

.datosgob-ai {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  color: #0f172a;
  padding: 24px;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 800px;
  margin: 0 auto;
}



.dg-link {
  font-size: 14px;
  text-decoration: none;
  color: #2563eb;
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.1);
  transition: all 0.2s ease;
}

.dg-link:hover {
  background: rgba(37, 99, 235, 0.2);
  transform: translateY(-1px);
}

.dg-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  margin: 16px 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.dg-card:hover {
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.dg-label {
  font-weight: 600;
  font-size: 16px;
  display: block;
  margin-bottom: 12px;
  color: #1e293b;
}

.dg-select, .dg-textarea {
  width: 100%;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: #fff;
}

.dg-select:focus, .dg-textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.dg-textarea {
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
}

.dg-select[size] {
  font-family: inherit;
  line-height: 1.4;
}

.dg-select[size] option {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
}

.dg-select[size] option:hover {
  background-color: #f8fafc;
}

.dg-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dg-btn, .dg-btn-primary, .dg-btn-ghost {
  border-radius: 12px;
  padding: 12px 20px;
  border: 2px solid;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}

.dg-btn {
  background: #1e293b;
  border-color: #1e293b;
  color: #fff;
}

.dg-btn:hover {
  background: #334155;
  border-color: #334155;
  transform: translateY(-1px);
}

.dg-btn-ghost {
  background: transparent;
  color: #1e293b;
  border-color: #1e293b;
}

.dg-btn-ghost:hover {
  background: #1e293b;
  color: #fff;
  transform: translateY(-1px);
}

.dg-btn-ghost.small {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.dg-btn-primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.dg-btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  transform: translateY(-1px);
}

.dg-answer {
  white-space: pre-wrap;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: #374151;
}

.dg-help {
  font-size: 13px;
  color: #64748b;
  margin-top: 8px;
  font-style: italic;
}

.dg-error {
  background: #fef2f2;
  color: #991b1b;
  border: 2px solid #fecaca;
  padding: 16px;
  border-radius: 12px;
  margin-top: 16px;
  font-weight: 500;
}

.dg-loading {
  margin-top: 16px;
  font-size: 14px;
  color: #64748b;
  text-align: center;
  padding: 16px;
}

.dg-question-examples {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.dg-question-example {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.dg-question-example:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dg-preview {
  margin-top: 16px;
  max-height: 300px;
  overflow: auto;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  padding: 16px;
  border-radius: 12px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 12px;
  line-height: 1.4;
}

.dg-preview summary {
  cursor: pointer;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.dg-preview pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Responsive */
@media (max-width: 768px) {
  .datosgob-ai {
    padding: 16px;
    border-radius: 16px;
  }
  

  
  .dg-actions {
    flex-direction: column;
  }
  
  .dg-btn, .dg-btn-primary, .dg-btn-ghost {
    width: 100%;
  }
}

/* Animaciones */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.dg-card {
  animation: fadeIn 0.3s ease-out;
}

/* Estados de carga */
.dg-loading::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  border-top-color: #2563eb;
  animation: spin 1s ease-in-out infinite;
  margin-left: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
