/* ============================================================
   GENERADOR DE HORÓSCOPOS DIARIOS - FIJATE TOOLS
   CSS Moderno, Responsive & Optimizado
   ============================================================ */

:root {
  --bg-main: #0b0f19;
  --bg-surface: #111827;
  --bg-card: #1f2937;
  --bg-card-hover: #263345;
  --bg-input: #0f172a;
  --border-color: #374151;
  --border-focus: #a855f7;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  --accent-primary: #a855f7;
  --accent-primary-hover: #9333ea;
  --accent-primary-glow: rgba(168, 85, 247, 0.28);

  --accent-gold: #fbbf24;
  --accent-cyan: #38bdf8;
  --accent-pink: #ec4899;
  --accent-emerald: #10b981;
  --accent-danger: #ef4444;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 24px rgba(168, 85, 247, 0.35);

  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-title: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   CABECERA (.app-header)
   ============================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  height: 64px;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-back-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.2s ease;
}

.btn-back-tools:hover {
  color: var(--text-main);
  border-color: var(--accent-primary);
  background: rgba(168, 85, 247, 0.08);
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo-box {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(251, 191, 36, 0.3));
  border: 1px solid rgba(168, 85, 247, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c084fc;
}

.brand-text {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.brand-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-header-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-header-action:hover {
  color: var(--text-main);
  border-color: var(--accent-primary);
  background: rgba(168, 85, 247, 0.08);
}

.history-count-badge {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--accent-primary);
  color: #fff;
  border-radius: 9999px;
  padding: 0 4px;
}

/* ============================================================
   CONTENEDOR PRINCIPAL (.app-main-container)
   ============================================================ */
.app-main-container {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Barra de introducción */
.tool-intro-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 0.25rem;
}

.tool-main-heading {
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.tool-main-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  max-width: 800px;
}

.horoscope-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.28);
  color: #c084fc;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
}

/* PESTAÑAS DE PERÍODO TEMPORAL */
.time-period-switcher {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.35rem;
  border-radius: var(--radius-lg);
  align-self: flex-start;
}

.btn-period-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-period-tab:hover {
  color: #fff;
}

.btn-period-tab.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.35);
}

/* GRID DE LOS 12 SIGNOS ZODIACALES */
.zodiac-signs-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.65rem;
}

.zodiac-sign-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.zodiac-sign-btn:hover {
  background: var(--bg-card);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.zodiac-sign-btn.active {
  background: rgba(168, 85, 247, 0.15);
  border-color: var(--accent-primary);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.25);
}

.zodiac-sign-symbol {
  font-size: 1.6rem;
  line-height: 1;
}

.zodiac-sign-name {
  font-family: var(--font-title);
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
}

.zodiac-sign-dates {
  font-size: 0.68rem;
  color: var(--text-dim);
}

/* ============================================================
   GRID DE TRABAJO (PREDICCIÓN + MÉTRICAS)
   ============================================================ */
.horoscope-workspace-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  align-items: start;
}

.workspace-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card-section-title {
  font-family: var(--font-title);
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
}

/* HERO CARD DEL SIGNO */
.hero-sign-box {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(251, 191, 36, 0.12));
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.hero-sign-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-sign-dates {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
}

.hero-sign-element {
  font-size: 0.75rem;
  font-weight: 600;
  color: #fbbf24;
}

.hero-sign-title-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.hero-sign-symbol {
  font-size: 2.4rem;
  line-height: 1;
}

.hero-sign-name {
  font-family: var(--font-title);
  font-size: 1.65rem;
  font-weight: 800;
  color: #fff;
}

.hero-sign-ruler {
  font-size: 0.8125rem;
  color: var(--text-dim);
}

.hero-sign-quote {
  font-style: italic;
  font-size: 0.875rem;
  color: #e2e8f0;
  line-height: 1.5;
}

/* 3 PILARES: AMOR, TRABAJO, SALUD */
.horoscope-pillars-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.pillar-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.pillar-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pillar-icon {
  font-size: 1.25rem;
}

.pillar-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.pillar-text {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.prediction-actions-row {
  display: flex;
  justify-content: flex-end;
}

.btn-tool-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-tool-action:hover {
  border-color: var(--accent-primary);
  color: #fff;
}

/* ============================================================
   PANEL DERECHO: MÉTRICAS ENERGÉTICAS Y FORTUNA
   ============================================================ */
.energy-meters-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.energy-meter-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.energy-meter-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.energy-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.energy-val {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  color: #fff;
}

.meter-bar-track {
  height: 8px;
  background: var(--bg-input);
  border-radius: 9999px;
  overflow: hidden;
}

.meter-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.4s ease-out;
}

.energy-fill { background: linear-gradient(90deg, #a855f7, #ec4899); }
.luck-fill { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.intuition-fill { background: linear-gradient(90deg, #38bdf8, #0ea5e9); }
.passion-fill { background: linear-gradient(90deg, #f43f5e, #e11d48); }

/* CLAVES DE LA FORTUNA */
.fortune-details-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.fortune-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fbbf24;
}

.fortune-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.fortune-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.fortune-card-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 500;
}

.fortune-card-val {
  font-family: var(--font-title);
  font-size: 0.875rem;
  color: #fff;
  font-weight: 700;
}

.astro-advice-box {
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  color: #c084fc;
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* ============================================================
   SECCIÓN EDUCATIVA Y FAQ
   ============================================================ */
.tool-content-info {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.info-columns-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.info-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.info-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.25);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-card-title {
  font-family: var(--font-title);
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
}

.info-card-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* FAQ Box */
.faq-container-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
}

.faq-main-title {
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.25rem;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.faq-item[open] {
  border-color: var(--accent-primary);
}

.faq-question {
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-arrow {
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-arrow {
  transform: rotate(180deg);
  color: var(--accent-primary);
}

.faq-answer {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ============================================================
   DRAWER HISTORIAL
   ============================================================ */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
}

.drawer-panel {
  width: 400px;
  max-width: 100%;
  height: 100%;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.25s ease-out;
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

.drawer-title-box h3 {
  font-family: var(--font-title);
  font-size: 1.125rem;
}

.btn-drawer-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-drawer-close:hover {
  color: #fff;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.history-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.history-item-card:hover {
  border-color: var(--accent-primary);
}

.history-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.history-item-expr {
  font-size: 0.8125rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-empty-message {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-dim);
  padding: 2rem 0;
}

.drawer-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
}

.btn-drawer-danger {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: transparent;
  color: var(--accent-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
}

.btn-drawer-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* ============================================================
   MODALES CUSTOM
   ============================================================ */
.custom-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.custom-modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 440px;
  max-width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.custom-modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.custom-modal-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.custom-modal-title h3 {
  font-family: var(--font-title);
  font-size: 1.125rem;
  color: #fff;
}

.btn-modal-close {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
}

.custom-modal-body {
  padding: 1.25rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.custom-modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

.btn-modal-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.btn-modal-secondary:hover {
  background: var(--bg-card-hover);
}

.btn-modal-danger {
  background: var(--accent-danger);
  border: none;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.btn-modal-danger:hover {
  background: #dc2626;
}

/* ============================================================
   TOAST FLOTANTE
   ============================================================ */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  background: #a855f7;
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-notification.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ============================================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ============================================================ */
@media (max-width: 1024px) {
  .horoscope-workspace-grid {
    grid-template-columns: 1fr;
  }
  
  .zodiac-signs-grid {
    grid-template-columns: repeat(4, 1fr);
  }

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

@media (max-width: 640px) {
  .btn-text-desktop {
    display: none;
  }
  
  .tool-main-heading {
    font-size: 1.35rem;
  }

  .zodiac-signs-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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