/* 
   VARIABLES (Paleta biblioteca)
*/
:root {
  --bg-color: #f9f7f2;

  --primary-color: #e07a5f;
  --secondary-color: #f2cc8f;
  --accent-color: #a8dadc;

  --text-dark: #3d405b;
  --text-light: #818181;

  --card-bg: #ffffff;
  --border-color: #eaeaea;
  --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  background: linear-gradient(135deg, var(--bg-color) 0%, #f0ebe0 100%);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 60px;
}

/*LANDING */

.landing {
  width: 100%;
  height: 100vh;
}

.hero {
  background-image: url("img/landing_bg.png");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;

  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;

  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(249, 247, 242, 0.85),
    rgba(242, 204, 143, 0.2)
  );
}

.hero__content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;

  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-soft);
  border-radius: 18px;
  padding: 28px 22px;
  max-width: 460px;
  margin: 0 16px;
}

.content__logo {
  width: 160px;
  border-radius: 50%;
  margin-bottom: 20px;
  border: 3px solid rgba(224, 122, 95, 0.35);
}

.content__slogan {
  font-size: 1.05rem;
  color: var(--text-dark);
  letter-spacing: 0.5px;
  max-width: 34rem;
  margin-bottom: 18px;
}

/* Botón CTA de la landing */
.button__cta {
  background-color: var(--primary-color);
  color: #ffffff;

  padding: 12px 22px;
  border-radius: 10px;
  border: 1px solid rgba(61, 64, 91, 0.15);
  cursor: pointer;

  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1px;

  box-shadow: 0 6px 0 rgba(165, 88, 67, 0.55);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    opacity 0.2s;
}

.button__cta:hover {
  opacity: 0.95;
  transform: translateY(-2px);
}

.button__cta:active {
  transform: translateY(1px);
  box-shadow: 0 3px 0 rgba(165, 88, 67, 0.55);
}

/* Wrapper de la app */
.app-root[hidden] {
  display: none;
}

/* APP */

.main-header {
  background-color: var(--card-bg);
  padding: 1rem 2rem;

  display: flex;
  align-items: center;
  justify-content: space-between;

  flex-wrap: wrap;
  gap: 12px;

  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 220px;
}

.logo-icon {
  font-size: 2rem;
  line-height: 1;
}

.brand-text h1 {
  font-size: 1.4rem;
  color: var(--primary-color);
  line-height: 1.2;
}

.brand-text p {
  font-size: 0.85rem;
  color: var(--text-light);
}

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

.main-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  flex: 1;
}

.search-section {
  margin-bottom: 25px;
}

.search-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

input[type="text"] {
  flex: 1;
  min-width: 220px;
  padding: 12px 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s;
}

input[type="text"]:focus {
  border-color: var(--primary-color);
}

.search-note {
  font-size: 0.8rem;
  color: var(--text-light);
  font-style: italic;
  margin-left: 5px;
}

.layout-grid {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 20px;
  align-items: start;
}

.card {
  background-color: var(--card-bg);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

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

.card-header h2 {
  font-size: 1.1rem;
  color: var(--text-dark);
}

.graph-canvas {
  width: 100%;
  height: 60vh;
  min-height: 420px;

  background-color: #fafafa;
  border: 2px dashed #e0e0e0;
  border-radius: 8px;

  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.graph-canvas.graph-ready {
  border: 1px solid var(--border-color);
  background-color: #ffffff;
}

.placeholder-message {
  text-align: center;
  color: var(--text-light);
  padding: 10px;
}

.status-badge {
  background-color: var(--secondary-color);
  color: #5d4037;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: bold;
  white-space: nowrap;
}

.legend {
  margin-top: 15px;
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.legend-item {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.dot-book {
  background-color: var(--primary-color);
}

.dot-category {
  background-color: var(--accent-color);
}

.divider {
  border: 0;
  height: 1px;
  background: #eee;
  margin: 20px 0;
}

.help-section h3 {
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.help-section ul {
  list-style-position: inside;
  padding-left: 0;
}

.help-section li {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 5px;
}

.text-placeholder {
  color: var(--text-light);
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.btn:hover {
  opacity: 0.85;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: #5d4037;
}

.btn-small {
  background-color: #eee;
  color: var(--text-dark);
}

/* FOOTER */

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;

  padding: 12px 16px;
  text-align: center;
  font-size: 0.82rem;

  background: rgba(249, 247, 242, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  border-top: 1px solid rgba(224, 122, 95, 0.35);
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.06);
}

.site-footer p {
  max-width: 1000px;
  margin: 0 auto;
  line-height: 1.4;
}

.site-footer strong {
  color: var(--primary-color);
  font-weight: 600;
}

/* Responsive: tablet */
@media (max-width: 980px) {
  .main-header {
    padding: 1rem 1.25rem;
  }

  .main-container {
    padding: 16px;
  }

  .layout-grid {
    grid-template-columns: 1fr;
  }

  .graph-canvas {
    height: 55vh;
    min-height: 380px;
  }
}

/* Responsive: móvil */
@media (max-width: 520px) {
  .main-header {
    padding: 0.9rem 1rem;
    justify-content: center;
  }

  .brand-container {
    justify-content: center;
    text-align: center;
  }

  .brand-text h1 {
    font-size: 1.2rem;
  }

  .header-actions {
    width: 100%;
    justify-content: center;
  }

  .btn {
    padding: 10px 14px;
  }

  input[type="text"] {
    min-width: 100%;
  }

  .graph-canvas {
    height: 50vh;
    min-height: 340px;
  }

  .hero__content {
    padding: 22px 18px;
  }

  .content__logo {
    width: 140px;
  }
}
