/* style.css - Estilos para Bucle Val */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f5f5f5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.header {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 15px 0;
  margin-bottom: 30px;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  font-size: 24px;
  color: #2c3e50;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Botones */
.btn-primary,
.btn-secondary,
.btn-small,
.btn-icon,
.btn-icon-large,
.btn-danger {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font-size: 14px;
  transition: all 0.3s;
}

.btn-primary {
  background: #3498db;
  color: white;
  font-weight: 600;
}

.btn-primary:hover {
  background: #2980b9;
}

.btn-primary:disabled {
  background: #95a5a6;
  cursor: not-allowed;
}

.btn-secondary {
  background: #ecf0f1;
  color: #2c3e50;
}

.btn-secondary:hover {
  background: #d5dbdb;
}

.btn-danger {
  background: #e74c3c;
  color: white;
  font-weight: 500;
  font-size: 13px;
  padding: 8px 16px;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-small {
  padding: 5px 12px;
  font-size: 12px;
  background: #3498db;
  color: white;
}

.btn-small:hover {
  background: #2980b9;
}

.btn-icon,
.btn-icon-large {
  background: none;
  border: none;
  font-size: 20px;
  padding: 5px;
  cursor: pointer;
  color: #f39c12;
}

.btn-icon-large {
  font-size: 32px;
}

.btn-icon:hover,
.btn-icon-large:hover {
  color: #e67e22;
}

/* Login Box */
.login-box {
  max-width: 400px;
  margin: 100px auto;
  background: white;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-box h1 {
  text-align: center;
  color: #3498db;
  margin-bottom: 10px;
}

.login-box h2 {
  text-align: center;
  color: #2c3e50;
  font-size: 20px;
  margin-bottom: 30px;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  color: #2c3e50;
  font-weight: 600;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="file"],
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
}

.form-group textarea {
  resize: vertical;
  line-height: 1.5;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3498db;
}

.form-group small {
  display: block;
  margin-top: 5px;
  color: #7f8c8d;
  font-size: 12px;
}

/* Mensajes */
.error {
  background: #e74c3c;
  color: white;
  padding: 12px;
  border-radius: 5px;
  margin-bottom: 20px;
}

.info {
  background: #ecf0f1;
  padding: 15px;
  border-radius: 5px;
  margin-top: 20px;
  text-align: center;
}

.info p {
  margin: 5px 0;
  font-size: 13px;
}

/* Main Content */
.main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

@media (max-width: 768px) {
  .main-content {
    grid-template-columns: 1fr;
  }
}

/* Sections */
.form-section,
.history-section {
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.form-section h2,
.history-section h2 {
  margin-bottom: 20px;
  color: #2c3e50;
  font-size: 20px;
}

/* Loading */
#loading {
  text-align: center;
  padding: 20px;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Domains List */
.domains-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.domain-card {
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  padding: 15px;
  background: #fafafa;
}

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

.domain-header h3 {
  font-size: 16px;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 8px;
}

.favorite-star {
  color: #f39c12;
  font-size: 18px;
}

.mode-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-left: 8px;
}

.mode-baseline {
  background: #e3f2fd;
  color: #1976d2;
}

.mode-asymmetric {
  background: #fff3e0;
  color: #e65100;
}

.domain-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.domain-meta {
  display: flex;
  gap: 15px;
  color: #7f8c8d;
  font-size: 13px;
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: #7f8c8d;
}

/* Domain Detail */
.domain-detail {
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.domain-title {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
}

.domain-title h2 {
  color: #2c3e50;
  font-size: 28px;
}

.metadata {
  color: #7f8c8d;
  font-size: 14px;
  margin-bottom: 30px;
}

/* Keywords Section */
.keywords-section {
  margin-bottom: 40px;
}

.keywords-section h3 {
  color: #2c3e50;
  margin-bottom: 15px;
  font-size: 18px;
}

.keywords-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.keyword-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 5px;
  border-left: 3px solid #3498db;
  flex-wrap: wrap;
}

.keyword-rank {
  font-weight: bold;
  color: #3498db;
  min-width: 30px;
}

.keyword-name {
  flex: 1;
  color: #2c3e50;
  min-width: 200px;
}

.keyword-volume {
  color: #27ae60;
  font-size: 13px;
  font-weight: 600;
}

.keyword-difficulty {
  color: #e67e22;
  font-size: 12px;
  background: #fef5e7;
  padding: 3px 8px;
  border-radius: 3px;
}

.keyword-traffic {
  color: #8e44ad;
  font-size: 12px;
  background: #f4ecf7;
  padding: 3px 8px;
  border-radius: 3px;
}

/* Response Section */
.response-section {
  margin-top: 40px;
}

.response-section > h3 {
  color: #2c3e50;
  margin-bottom: 25px;
  font-size: 22px;
  border-bottom: 3px solid #3498db;
  padding-bottom: 12px;
  font-weight: 600;
}

.response-content {
  line-height: 1.8;
  color: #2c3e50;
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: 15px;
}

/* Estilos para bloques de ideas del LLM */
.response-content .idea-block {
  background: #ffffff;
  border: 1px solid #e1e8ed;
  border-radius: 8px;
  padding: 40px;
  margin-bottom: 30px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.response-content .idea-block:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  border-color: #cbd6e0;
}

.response-content .idea-block:last-child {
  margin-bottom: 0;
}

.response-cont4px;
  color: #2c3e50;
  margin: 0 0 32px 0;
  padding-bottom: 16px;
  border-bottom: 1px solid #e1e8ed;
  font-weight: 600;
  line-height: 1.4;
  display: flex;
  align-items: center;
}

.response-content .idea-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f7f9fa;
  color: #5a6c7d;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  margin-right: 12px;
  min-width: 45px;
  border: 1px solid #e1e8ed
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

/* Secciones dentro de cada idea */
.response-content .section {
  margin-bottom: 8px;
  margin-top: 32px;
  padding: 0;
}

.response-content .section:first-child {
  margin-top: 0;
}

.response-content .section:last-child {
  margin-bottom: 0;
}

.response-content .section-title {
  font-size: 14px;
  font-weight: 600;
  color: #7f8c8d;
  margin: 0 0 10px 0;
  text-transform: none;
  letter-spacing: 0.3px;
  display: block;
}

.response-content .section p {
  margin: 8px 0;
  color: #2c3e50;
  line-height: 1.9;
  font-size: 15px;
}

.response-content .section p:first-of-type {
  margin-top: 0;
}

.response-content .section p:last-of-type {
  margin-bottom: 0;
}

/* Listas dentro de secciones */
.response-content .section ul {
  margin: 12px 0;
  padding-left: 0;
  list-style: none;
}

.response-content .section ul li {
  margin: 10px 0;
  color: #2c3e50;
  line-height: 1.8;
  padding-left: 22px;
  position: relative;
}

.response-content .section ul li:before {
  content: "•";
  color: #95a5a6;
  font-weight: normal;
  font-size: 18px;
  position: absolute;
  left: 6px;
  top: -1px;
}

.response-content .section ul li strong {
  color: #2c3e50;
  font-weight: 600;
}

/* Listas fuera de secciones (fallback) */
.response-content ul {
  margin: 12px 0;
  padding-left: 0;
  list-style: none;
}

.response-content ul li {
  margin: 10px 0;
  color: #2c3e50;
  line-height: 1.8;
  padding-left: 22px;
  position: relative;
}

.response-content ul li:before {
  content: "•";
  color: #95a5a6;
  font-weight: normal;
  font-size: 18px;
  position: absolute;
  left: 6px;
  top: -1px;
}

/* Estilos generales dentro de response-content */
.response-content > p {
  margin: 15px 0;
  line-height: 1.8;
  color: #34495e;
}

.response-content strong {
  color: #2c3e50;
  font-weight: 600;
}

.response-content code {
  background: #e8f4fd;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: "Courier New", monospace;
  color: #2980b9;
  font-size: 14px;
  font-size: 13px;
  color: #e74c3c;
}

/* Error Box */
.error-box {
  max-width: 500px;
  margin: 100px auto;
  background: white;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.error-box h1 {
  color: #e74c3c;
  margin-bottom: 20px;
}

.error-box .error {
  margin-bottom: 20px;
}

/* Ideas Cards */
.idea-card {
  background: white;
  border: 1px solid #e1e8ed;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  transition: all 0.2s ease;
}

.idea-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #cbd6e0;
}

.idea-card-header {
  background: #f7f9fa;
  padding: 20px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid #e1e8ed;
  gap: 15px;
}

.idea-card-header > div:first-child {
  flex: 1;
  min-width: 0;
}

.idea-card-header > div:last-child {
  flex: 0 0 auto;
}

.idea-card-header > a {
  flex: 1 1 auto;
  text-decoration: none;
  min-width: 0;
  align-self: center;
}

.idea-card-title {
  margin: 0 !important;
  font-size: 18px;
  color: #2c3e50;
  font-weight: 600;
  line-height: 1.3;
  transition: color 0.2s ease;
  display: block;
}

.idea-card-header > a:hover .idea-card-title {
  color: #3498db;
}

.idea-card-title .idea-number {
  display: inline-block;
  background: #e8eef3;
  color: #5a6c7d;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  margin-right: 8px;
}

.idea-card-title:hover {
  color: #3498db;
}

.idea-card-domain {
  font-size: 13px;
  color: #7f8c8d;
}

.idea-card-content {
  padding: 20px;
}

.idea-field {
  margin-bottom: 16px;
}

.idea-field:last-of-type {
  margin-bottom: 0;
}

.idea-field strong {
  color: #5a6c7d;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 6px;
}

.idea-field div {
  color: #2c3e50;
  line-height: 1.6;
}

.idea-card-meta {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f0f3f5;
  font-size: 12px;
  color: #95a5a6;
}

.alert {
  padding: 15px 20px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
}

.alert-success {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.alert-info {
  background: #d1ecf1;
  border: 1px solid #bee5eb;
  color: #0c5460;
}
