/* ==========================================================================
   Carta Astral Interactiva - Estilos Cósmicos Premium
   Fijate Tools
   ========================================================================== */

:root {
  color-scheme: dark;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-title: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --astro-bg: var(--bg-body, #070b14);
  --astro-card-bg: var(--bg-card, rgba(13, 21, 39, 0.75));
  --astro-card-border: var(--border-color, rgba(255, 255, 255, 0.08));
  --astro-card-hover: rgba(26, 38, 66, 0.85);
  --astro-input-bg: #0e1522;
  --astro-text-primary: var(--text-main, #f8fafc);
  --astro-text-secondary: var(--text-secondary, #94a3b8);
  --astro-text-muted: var(--text-muted, #64748b);
  --astro-gold: #ff8507;
  --astro-gold-glow: rgba(255, 133, 7, 0.25);
  --astro-cyan: #06b6d4;
  --astro-purple: #8b5cf6;
  --astro-red: #ef4444;
  --astro-green: #10b981;
  --astro-blue: #3b82f6;

  /* Elementos */
  --elem-fuego: #ff8507;
  --elem-tierra: #10b981;
  --elem-aire: #38bdf8;
  --elem-agua: #818cf8;
}

[data-theme="light"] {
  color-scheme: light;
  --astro-bg: #f8fafc;
  --astro-card-bg: #ffffff;
  --astro-card-border: #e2e8f0;
  --astro-card-hover: #f1f5f9;
  --astro-input-bg: #ffffff;
  --astro-text-primary: #0f172a;
  --astro-text-secondary: #475569;
  --astro-text-muted: #64748b;
  --astro-gold: #ff8507;
  --astro-gold-glow: rgba(255, 133, 7, 0.15);
}

/* Layout General */
.astro-container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  font-family: var(--font-sans);
}

.astro-hero {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}

.astro-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  background: rgba(255, 133, 7, 0.12);
  border: 1px solid rgba(255, 133, 7, 0.3);
  color: var(--astro-gold);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-title);
}

.astro-title {
  font-family: var(--font-title);
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  font-weight: 800;
  color: var(--astro-text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.astro-subtitle {
  font-size: 1.05rem;
  color: var(--astro-text-secondary);
  max-width: 780px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Formulario de Entrada */
.astro-form-card {
  background: var(--astro-card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--astro-card-border);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.astro-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  align-items: flex-end;
}

.astro-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
}

.astro-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--astro-text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.astro-input,
.astro-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--astro-input-bg);
  border: 1px solid var(--astro-card-border);
  border-radius: 0.6rem;
  color: var(--astro-text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s ease;
  color-scheme: dark;
}

.astro-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 16px 16px;
  padding-right: 2.5rem;
  cursor: pointer;
}

.astro-select option {
  background-color: #0e1522;
  color: #f8fafc;
  padding: 0.75rem 1rem;
}

[data-theme="light"] .astro-input,
[data-theme="light"] .astro-select {
  background-color: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
  color-scheme: light;
}

[data-theme="light"] .astro-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

[data-theme="light"] .astro-select option {
  background-color: #ffffff;
  color: #0f172a;
}

.astro-input:focus,
.astro-select:focus {
  outline: none;
  border-color: var(--astro-gold);
  box-shadow: 0 0 0 3px var(--astro-gold-glow);
}

/* Autocompletado de Ciudades */
.city-autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.6rem;
  margin-top: 0.25rem;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  list-style: none;
  padding: 0.25rem;
}

[data-theme="light"] .city-autocomplete-list {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.city-autocomplete-item {
  padding: 0.6rem 0.85rem;
  border-radius: 0.4rem;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--astro-text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s ease;
}

.city-autocomplete-item:hover,
.city-autocomplete-item.active {
  background: rgba(245, 158, 11, 0.18);
  color: var(--astro-gold);
}

.city-country {
  font-size: 0.75rem;
  color: var(--astro-text-muted);
}

/* Botones de Acción */
.astro-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--astro-card-border);
}

.astro-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.6rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  text-decoration: none;
}

.astro-btn-primary {
  background: var(--astro-gold);
  color: #0b0f17 !important;
  box-shadow: 0 4px 15px var(--astro-gold-glow);
}

.astro-btn-primary:hover {
  background: #d97706;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
}

.astro-btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--astro-text-primary);
  border: 1px solid var(--astro-card-border);
}

.astro-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--astro-text-primary);
}

/* Pestañas de Navegación */
.astro-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--astro-card-border);
  scrollbar-width: thin;
}

.astro-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.15rem;
  border-radius: 0.6rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--astro-text-secondary);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.astro-tab-btn:hover {
  color: var(--astro-text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.astro-tab-btn.active {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: var(--astro-gold);
}

/* Paneles de Contenido */
.astro-tab-panel {
  display: none;
  animation: astroFadeIn 0.3s ease-out;
}

.astro-tab-panel.active {
  display: block;
}

@keyframes astroFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sección Rueda Astral */
.wheel-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 992px) {
  .wheel-layout {
    grid-template-columns: 1fr;
  }
}

.wheel-stage {
  background: var(--astro-card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--astro-card-border);
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.wheel-svg-container {
  width: 100%;
  max-width: 650px;
  aspect-ratio: 1 / 1;
  position: relative;
  user-select: none;
}

.wheel-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.4));
}

/* Elementos interactivos del SVG */
.zodiac-sign-sector {
  cursor: pointer;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.zodiac-sign-sector:hover {
  filter: brightness(1.25);
}

.planet-glyph-group {
  cursor: pointer;
}

.planet-glyph-group circle {
  transition: r 0.2s cubic-bezier(0.4, 0, 0.2, 1), stroke-width 0.2s ease, filter 0.2s ease;
}

.planet-glyph-group:hover circle {
  r: 16px;
  stroke-width: 2.2px;
  filter: drop-shadow(0 0 8px rgba(255, 133, 7, 0.65));
}

.planet-glyph-group text {
  transition: filter 0.2s ease;
}

.planet-glyph-group:hover text {
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.7));
}

.aspect-line {
  transition: opacity 0.25s ease, stroke-width 0.25s ease;
}

/* Sidebar de Detalle de la Rueda */
.wheel-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.astro-card {
  background: var(--astro-card-bg);
  border: 1px solid var(--astro-card-border);
  border-radius: 0.85rem;
  padding: 1.25rem;
}

.astro-card-title {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--astro-text-primary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Tríada Mayor (Cards) */
.triad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.triad-card {
  background: var(--astro-card-bg);
  border: 1px solid var(--astro-card-border);
  border-radius: 1rem;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.triad-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.triad-card.sun-card::before { background: linear-gradient(90deg, #ff8507, #f59e0b); }
.triad-card.moon-card::before { background: linear-gradient(90deg, #818cf8, #c7d2fe); }
.triad-card.asc-card::before { background: linear-gradient(90deg, #06b6d4, #38bdf8); }

.triad-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.triad-symbol {
  width: 52px;
  height: 52px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--astro-card-border);
}

.triad-meta h3 {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--astro-text-primary);
  margin-bottom: 0.2rem;
}

.triad-zodiac {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--astro-gold);
}

.triad-desc {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--astro-text-secondary);
}

/* Tabla de Posiciones Planetarias */
.astro-table-container {
  background: var(--astro-card-bg);
  border: 1px solid var(--astro-card-border);
  border-radius: 0.85rem;
  overflow-x: auto;
}

.astro-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.astro-table th {
  background: rgba(0, 0, 0, 0.2);
  padding: 0.85rem 1rem;
  font-weight: 600;
  color: var(--astro-text-secondary);
  border-bottom: 1px solid var(--astro-card-border);
}

.astro-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--astro-text-primary);
}

.astro-table tr:last-child td {
  border-bottom: none;
}

.astro-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.planet-cell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
}

.planet-icon {
  font-size: 1.15rem;
  width: 26px;
  text-align: center;
}

.retro-badge {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.18);
  color: var(--astro-red);
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 0.35rem;
}

/* Balances de Elementos y Modalidades */
.balance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.balance-item {
  margin-bottom: 1rem;
}

.balance-item-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--astro-text-primary);
}

.balance-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.balance-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Módulo de Tránsitos y Predicciones */
.transit-control-bar {
  background: var(--astro-card-bg);
  border: 1px solid var(--astro-card-border);
  border-radius: 0.85rem;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.predictions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

.prediction-card {
  background: var(--astro-card-bg);
  border: 1px solid var(--astro-card-border);
  border-radius: 0.85rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.prediction-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.prediction-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: rgba(245, 158, 11, 0.12);
  color: var(--astro-gold);
}

.prediction-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--astro-text-primary);
}

.prediction-body {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--astro-text-secondary);
}

/* Modal de Información y Avisos */
.astro-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.astro-modal-backdrop.open {
  display: flex;
  animation: astroFadeIn 0.2s ease-out;
}

.astro-modal {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 1rem;
  max-width: 540px;
  width: 100%;
  padding: 1.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .astro-modal {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.astro-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--astro-card-border);
}

.astro-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--astro-text-primary);
}

.astro-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--astro-text-muted);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.astro-modal-close:hover {
  color: var(--astro-text-primary);
}

/* Impresión */
@media print {
  .no-print,
  .astro-tabs,
  .astro-actions,
  .tool-sidebar,
  .cookie-consent-banner,
  .site-header,
  .site-footer {
    display: none !important;
  }

  .astro-tab-panel {
    display: block !important;
    page-break-after: always;
  }

  .astro-card-bg {
    background: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #ddd !important;
  }
}
