/* ═══════════════════════════════════════════════════════════════ */
/* CASCABELERA - STYLES.CSS                                        */
/* ═══════════════════════════════════════════════════════════════ */

:root {
  --amber: #FF9500;
  --ink: #1C1C1E;
  --ink-soft: #48484A;
  --ink-muted: #8E8E93;
  --paper: #FAFAF8;
  --surface: #F5F5F7;
  --border: #E5E5EA;
  --teal: #30B0C7;
  --green: #34C759;
  --coral: #FF6B6B;
  --violet: #7B61FF;
  --gold: #F7C948;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

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

body {
  font-family: 'Nunito', sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  font-size: 17px;
}

/* ═══════════ NAVBAR ═══════════ */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,250,248,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
}

.nav-logo {
  font-family: 'Fraunces', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo img { display: none; }

.nav-links {
  display: flex; align-items: center; gap: 4px;
  list-style: none;
}

.nav-links a {
  padding: 8px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600; font-size: 0.95rem;
  transition: all 0.2s;
}

.nav-links a:hover { background: var(--border); color: var(--ink); }

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

.btn-login {
  padding: 10px 18px; border-radius: 10px;
  border: 1.5px solid var(--border);
  background: transparent;
  font-family: 'Nunito', sans-serif;
  font-weight: 700; font-size: 0.95rem;
  color: var(--ink-soft); cursor: pointer;
  transition: all 0.2s;
}

.btn-login:hover { border-color: var(--amber); color: var(--amber); }

.btn-cta-nav {
  padding: 10px 20px; border-radius: 10px;
  background: var(--amber);
  border: none; cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-weight: 700; font-size: 0.95rem;
  color: white;
  transition: all 0.2s;
}

.btn-cta-nav:hover { background: #E8870A; transform: translateY(-1px); }

.hamburger { display: none; }

.mobile-menu {
  position: fixed; top: 0; right: -100%; height: 100vh; width: 280px;
  background: white; z-index: 200;
  padding: 80px 24px 24px;
  box-shadow: -4px 0 24px rgba(0,0,0,0.1);
  transition: right 0.3s ease;
  display: flex; flex-direction: column; gap: 8px;
}

.mobile-menu.active { right: 0; }
.mobile-menu.open { right: 0; }

.mobile-menu a {
  padding: 12px 16px; border-radius: 10px;
  text-decoration: none; color: var(--ink);
  font-weight: 600; transition: background 0.2s;
}

.mobile-menu a:hover { background: var(--surface); }

@media (max-width: 768px) {
  .nav-links, .nav-actions { display: none; }
  .hamburger {
    display: flex; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer;
  }
  .hamburger span {
    width: 24px; height: 2px; background: var(--ink);
    transition: all 0.3s;
  }
  body { font-size: 16px; }
}

/* ═══════════ BANNER ROTANTE ═══════════ */
.hero-banner {
  position: relative;
  width: 100%;
  height: 85vh;
  min-height: 520px;
  max-height: 800px;
  overflow: hidden;
  background: var(--ink);
}

.banner-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

.banner-slide.active {
  opacity: 1;
}

.banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0,0,0,0.72) 0%,
    rgba(0,0,0,0.45) 50%,
    rgba(0,0,0,0.15) 100%
  );
}

.banner-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 8%;
}

.banner-text {
  max-width: 600px;
  color: white;
}

.banner-tag {
  display: inline-block;
  padding: 6px 16px;
  background: var(--amber);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.banner-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 16px;
  color: white;
  text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.banner-description {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.6;
  color: rgba(255,255,255,0.88);
  margin-bottom: 32px;
  max-width: 480px;
}

.banner-cta {
  display: inline-block;
  padding: 16px 32px;
  background: var(--amber);
  color: white;
  border: none;
  border-radius: 12px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(255,149,0,0.4);
}

.banner-cta:hover {
  background: #E8870A;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255,149,0,0.5);
}

.banner-dots {
  position: absolute;
  bottom: 28px;
  left: 8%;
  display: flex;
  gap: 10px;
  z-index: 10;
}

.banner-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.banner-dot.active {
  background: var(--amber);
  transform: scale(1.3);
}

@media (max-width: 768px) {
  .hero-banner {
    height: 75vh;
    min-height: 460px;
  }
  .banner-content {
    padding: 0 24px;
    align-items: flex-end;
    padding-bottom: 80px;
  }
  .banner-overlay {
    background: linear-gradient(
      to top,
      rgba(0,0,0,0.80) 0%,
      rgba(0,0,0,0.40) 60%,
      rgba(0,0,0,0.10) 100%
    );
  }
  .banner-text {
    max-width: 100%;
  }
  .banner-dots {
    left: 24px;
    bottom: 20px;
  }
}

/* ═══════════ SECCIONES ═══════════ */
.section {
  padding: 60px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .section { padding: 40px 20px; }
}

.section-label {
  text-transform: uppercase;
  font-size: 0.9rem; font-weight: 800;
  color: var(--amber); letter-spacing: 1.5px;
  margin-bottom: 12px;
}

.section-title {
  font-family: 'Fraunces', serif;
  font-size: 2.5rem; font-weight: 700;
  color: var(--ink); margin-bottom: 16px;
}

.section-sub {
  font-size: 1.15rem; color: var(--ink-soft);
  max-width: 600px; line-height: 1.7;
}

/* ═══════════ GENERADOR ═══════════ */
.generator-form {
  max-width: 700px;
  margin: 40px auto 0;
  background: white;
  padding: 32px;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}

.value-pills {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 28px;
}

.value-pill {
  padding: 10px 20px; border-radius: 20px;
  border: 1.5px solid;
  font-weight: 700; font-size: 0.95rem;
  cursor: pointer; transition: all 0.2s;
  background: white;
}

.value-pill.selected {
  background: var(--amber);
  color: white !important;
  border-color: var(--amber) !important;
  transform: scale(1.05);
}

.value-pill:hover { transform: translateY(-2px); }

.value-pill:nth-child(1) { border-color: var(--amber); color: var(--amber); }
.value-pill:nth-child(2) { border-color: var(--teal); color: var(--teal); }
.value-pill:nth-child(3) { border-color: var(--green); color: var(--green); }
.value-pill:nth-child(4) { border-color: var(--coral); color: var(--coral); }
.value-pill:nth-child(5) { border-color: var(--violet); color: var(--violet); }
.value-pill:nth-child(6) { border-color: var(--gold); color: var(--gold); }

.form-row-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 640px) {
  .form-row-2 { grid-template-columns: 1fr; }
}

.form-row { margin-bottom: 18px; }

.form-label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 1rem;
}

.form-input, .form-select {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 1.05rem;
  transition: all 0.2s;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(255,149,0,0.1);
}

.btn-generate {
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  background: var(--amber);
  border: none;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 20px;
  position: relative;
}

.btn-generate:hover { background: #E8870A; transform: translateY(-2px); }
.btn-generate:disabled { opacity: 0.7; cursor: not-allowed; }

.progress-container {
  width: 100%; height: 4px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px; overflow: hidden;
  margin-top: 12px; display: none;
}

.btn-generate.loading .progress-container { display: block; }

.progress-bar {
  height: 100%; background: white;
  width: 0%; transition: width 0.3s ease;
  animation: progress 15s linear forwards;
}

@keyframes progress {
  0% { width: 0%; }
  100% { width: 95%; }
}

.bell-icon {
  display: none; font-size: 1.5rem;
  animation: ring 0.5s ease-in-out infinite;
}

.btn-generate.loading .bell-icon { display: inline-block; margin-left: 8px; }

@keyframes ring {
  0%, 100% { transform: rotate(-15deg); }
  50% { transform: rotate(15deg); }
}

/* OUTPUT DEL CUENTO */
.story-output {
  max-width: 700px;
  margin: 40px auto;
  background: white;
  padding: 40px;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s;
  max-height: 0;
  overflow: hidden;
}

.story-output.visible {
  opacity: 1;
  transform: translateY(0);
  max-height: 5000px;
}

.story-title {
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  margin-bottom: 24px;
  color: var(--ink);
}

.story-body { font-size: 1.1rem; line-height: 1.8; color: var(--ink-soft); }
.story-body p { margin-bottom: 16px; }

.story-preview-fade {
  position: relative; max-height: 300px; overflow: hidden;
}

.story-preview-fade::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 100px; background: linear-gradient(transparent, white);
}

.story-cta {
  text-align: center; margin-top: 32px; padding: 24px;
  background: var(--surface); border-radius: 12px;
}

.story-cta h4 { font-family: 'Fraunces', serif; font-size: 1.3rem; margin-bottom: 12px; }
.story-cta p { color: var(--ink-soft); margin-bottom: 20px; }

.story-actions {
  display: flex; gap: 12px;
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--border);
}

.btn-download, .btn-save {
  flex: 1; padding: 14px; border-radius: 10px;
  font-weight: 700; font-size: 1rem; cursor: pointer; transition: all 0.2s;
}

.btn-download { background: var(--amber); border: none; color: white; }
.btn-download:hover { background: #E8870A; }

.btn-save { background: white; border: 1.5px solid var(--border); color: var(--ink-soft); }
.btn-save:hover { border-color: var(--amber); color: var(--amber); }

/* ═══════════ TOP 3 ═══════════ */
.top-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.top-card {
  position: relative;
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}

.top-card:hover { transform: translateY(-4px); }

.top-card img { width: 100%; height: 200px; object-fit: cover; }

.top-number {
  position: absolute; top: 12px; left: 12px;
  width: 40px; height: 40px;
  background: var(--amber); color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 800; z-index: 2;
}

.top-card-body { padding: 16px; }

.top-card h4 {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem; margin: 0 0 8px;
}

.top-rating { color: var(--ink-soft); font-size: 0.9rem; }

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

/* ═══════════ BIBLIOTECA - CARDS ═══════════ */
.cuento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
}

@media (max-width: 1024px) {
  .cuento-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .cuento-grid { grid-template-columns: 1fr; }
}

.cuento-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.cuento-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.cuento-img {
  height: 200px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.cuento-tag {
  position: absolute;
  top: 12px; right: 12px;
  padding: 5px 12px;
  background: white;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.cuento-body { padding: 20px; }

.cuento-body h3 {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--ink);
  line-height: 1.3;
}

.cuento-body p {
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 12px;
}

.cuento-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-tag {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.stars {
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.btn-card {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-card:hover {
  background: var(--amber);
  border-color: var(--amber);
  color: white;
}

/* ═══════════ MÉTODO ═══════════ */
#metodo {
  padding: 50px 24px;
  background: var(--surface);
}

#autora { padding: 50px 24px; }

.metodo-section {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

@media (max-width: 768px) {
  .metodo-section { grid-template-columns: 1fr; gap: 28px; }
}

.metodo-pillars {
  max-width: 1200px;
  margin: 30px auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.metodo-pillars > div { padding: 24px; }

/* ═══════════ PLANES ═══════════ */
.planes-section {
  background: linear-gradient(135deg,#1C1C1E 0%,#2C2C2E 100%);
  padding: 60px 24px;
}

@media (max-width: 768px) {
  .planes-section { padding: 40px 20px; }
}

.planes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  max-width: 1000px;
  margin: 40px auto 0;
}

.plan-card {
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 28px;
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: all 0.3s;
}

.plan-card:hover { transform: translateY(-4px); }

.plan-card.selected {
  background: var(--amber);
  border-color: var(--amber);
  transform: scale(1.02);
}

.plan-card.selected * { color: white !important; }

.plan-card h3 {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem; color: white; margin-bottom: 12px;
}

.plan-card .plan-amount {
  font-size: 2.5rem; font-weight: 700;
  color: white; margin-bottom: 8px;
}

.plan-card .plan-amount span { font-size: 0.9rem; font-weight: 400; }

.plan-card ul { list-style: none; padding: 0; margin: 20px 0 28px; }

.plan-card li {
  padding: 8px 0; color: rgba(255,255,255,0.9);
  display: flex; align-items: center; gap: 8px; font-size: 0.95rem;
}

.plan-card button {
  width: 100%; padding: 14px; border-radius: 10px;
  font-weight: 700; cursor: pointer; transition: all 0.2s; font-size: 0.95rem;
}

/* ═══════════ FOOTER ═══════════ */
footer {
  background: var(--ink);
  color: rgba(255,255,255,0.8);
  padding: 50px 24px 24px;
}

footer .logo-text {
  font-family: 'Fraunces', serif;
  font-size: 1.5rem; font-weight: 700;
  color: white; margin-bottom: 16px;
}

footer a { color: rgba(255,255,255,0.7); text-decoration: none; transition: color 0.2s; }
footer a:hover { color: var(--amber); }

/* ═══════════ PESTAÑAS GENERADOR ═══════════ */
.category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: var(--surface);
  border-radius: 12px;
  padding: 6px;
}

.cat-tab {
  flex: 1;
  padding: 10px 8px;
  border-radius: 8px;
  border: none;
  background: transparent;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.cat-tab:hover { color: var(--ink); }

.cat-tab.active {
  background: white;
  color: var(--ink);
  box-shadow: var(--shadow);
}

@media (max-width: 480px) {
  .cat-tab { font-size: 0.78rem; padding: 8px 4px; }
}

/* ═══════════ STORY READER ═══════════ */
#storyReader.visible {
  opacity: 1;
  transform: translateY(0);
  max-height: 5000px;
}
