/* ============================================================
   ORÁCULO DEL SÍ O NO — styles.css
   Aesthetic: Mystical Oracle — Deep cosmos, floating particles,
   gold light, crystal ball energy
   ============================================================ */

/* === GOOGLE FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700&family=EB+Garamond:ital,wght@0,400;0,500;1,400&family=Raleway:wght@300;400;500&display=swap');

/* === CSS VARIABLES === */
:root {
  --cosmos-deep:    #050811;
  --cosmos-mid:     #0c1628;
  --cosmos-blue:    #1a2744;
  --mystic-purple:  #2d1b69;
  --accent-gold:    #d4a843;
  --accent-amber:   #f0c060;
  --light-gold:     #fde68a;
  --si-color:       #4ade80;
  --si-glow:        rgba(74, 222, 128, 0.4);
  --no-color:       #f87171;
  --no-glow:        rgba(248, 113, 113, 0.4);
  --quizas-color:   #a78bfa;
  --quizas-glow:    rgba(167, 139, 250, 0.4);
  --text-bright:    #f0e6c8;
  --text-mid:       #c4b08a;
  --text-dim:       #8a7a60;
  --glass-bg:       rgba(12, 22, 40, 0.7);
  --glass-border:   rgba(212, 168, 67, 0.2);
  --font-title:     'Cinzel Decorative', serif;
  --font-body:      'EB Garamond', serif;
  --font-ui:        'Raleway', sans-serif;
  --radius:         16px;
  --shadow-gold:    0 0 40px rgba(212, 168, 67, 0.15);
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* === CONTAINER (WordPress shortcode) === */
#oraculo-sino-app {
  font-family: var(--font-body);
  color: var(--text-bright);
  background: var(--cosmos-deep);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  width: 100%;
}

/* === STARFIELD BACKGROUND === */
.starfield {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: white;
  animation: twinkle var(--tw-dur, 3s) ease-in-out infinite;
  animation-delay: var(--tw-delay, 0s);
  opacity: 0;
}

@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.8); }
  50%       { opacity: var(--tw-max, 0.8); transform: scale(1); }
}

/* Nebula blobs */
.nebula {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: nebulaPulse 8s ease-in-out infinite alternate;
}
.nebula-1 { width: 500px; height: 500px; top: -100px; left: -150px; background: radial-gradient(circle, rgba(45,27,105,0.4) 0%, transparent 70%); }
.nebula-2 { width: 400px; height: 400px; bottom: -80px; right: -100px; background: radial-gradient(circle, rgba(26,39,68,0.5) 0%, transparent 70%); animation-delay: 3s; }
.nebula-3 { width: 300px; height: 300px; top: 40%; left: 50%; transform: translateX(-50%); background: radial-gradient(circle, rgba(212,168,67,0.06) 0%, transparent 70%); animation-delay: 1.5s; }

@keyframes nebulaPulse {
  from { opacity: 0.6; transform: scale(1); }
  to   { opacity: 1;   transform: scale(1.15); }
}

/* === MAIN WRAPPER === */
.oraculo-wrapper {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

/* === HEADER === */
.oraculo-header {
  text-align: center;
  margin-bottom: 50px;
  animation: fadeDown 0.8s ease both;
}

.header-emblem {
  width: 90px;
  height: 90px;
  margin: 0 auto 20px;
  position: relative;
}

.emblem-ring {
  width: 90px; height: 90px;
  border: 1.5px solid var(--accent-gold);
  border-radius: 50%;
  position: absolute;
  top: 0; left: 0;
  animation: rotateSlow 20s linear infinite;
  opacity: 0.6;
}

.emblem-ring-inner {
  width: 66px; height: 66px;
  border: 1px solid rgba(212,168,67,0.4);
  border-radius: 50%;
  position: absolute;
  top: 12px; left: 12px;
  animation: rotateSlow 14s linear infinite reverse;
}

.emblem-eye {
  width: 28px; height: 28px;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  fill: var(--accent-gold);
  opacity: 0.9;
  animation: eyePulse 3s ease-in-out infinite;
}

@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes eyePulse {
  0%, 100% { opacity: 0.7; filter: drop-shadow(0 0 4px var(--accent-gold)); }
  50%       { opacity: 1;   filter: drop-shadow(0 0 12px var(--accent-amber)); }
}

.oraculo-title {
  font-family: var(--font-title);
  font-size: clamp(1.4rem, 4vw, 2.1rem);
  color: var(--accent-amber);
  letter-spacing: 0.04em;
  text-shadow: 0 0 30px rgba(240,192,96,0.35);
  line-height: 1.3;
}

.oraculo-subtitle {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--text-dim);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 8px;
}

/* === CARD: GLASS PANEL === */
.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 32px;
  box-shadow: var(--shadow-gold), inset 0 1px 0 rgba(212,168,67,0.1);
}

/* === QUESTION SECTION === */
.question-section {
  margin-bottom: 28px;
  animation: fadeUp 0.8s ease 0.15s both;
}

.question-label {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mid);
  margin-bottom: 12px;
}

.question-input-wrap {
  position: relative;
}

.question-textarea {
  width: 100%;
  background: rgba(5, 8, 17, 0.6);
  border: 1px solid rgba(212, 168, 67, 0.25);
  border-radius: 10px;
  color: var(--text-bright);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
  padding: 16px 18px;
  resize: none;
  transition: border-color 0.3s, box-shadow 0.3s;
  outline: none;
  height: 110px;
}

.question-textarea::placeholder { color: var(--text-dim); font-style: italic; }
.question-textarea:focus {
  border-color: rgba(212, 168, 67, 0.55);
  box-shadow: 0 0 20px rgba(212, 168, 67, 0.1);
}

.char-count {
  position: absolute;
  bottom: 10px; right: 14px;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* === CONSULT BUTTON === */
.consult-btn {
  width: 100%;
  padding: 18px 32px;
  background: linear-gradient(135deg, #1a2744 0%, #2d1b69 50%, #1a2744 100%);
  border: 1px solid var(--accent-gold);
  border-radius: 10px;
  color: var(--accent-amber);
  font-family: var(--font-title);
  font-size: 1rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.3s;
  animation: fadeUp 0.8s ease 0.25s both;
}

.consult-btn::before {
  content: '';
  position: absolute;
  top: -50%; left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(212,168,67,0.15), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s;
}

.consult-btn:hover::before { left: 160%; }
.consult-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(212,168,67,0.2); }
.consult-btn:active { transform: translateY(0); }
.consult-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-inner { display: flex; align-items: center; justify-content: center; gap: 10px; }
.btn-icon { font-size: 1.2rem; }

/* === CRYSTAL BALL ORACLE === */
.oracle-stage {
  display: none;
  text-align: center;
  margin-top: 36px;
  animation: fadeUp 0.6s ease both;
}

.oracle-stage.visible { display: block; }

/* Crystal Ball */
.crystal-container {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 32px;
  cursor: pointer;
}

.crystal-ball {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 35% 35%, rgba(255,255,255,0.15) 0%, rgba(26,39,68,0.7) 40%, rgba(5,8,17,0.9) 100%);
  border: 1px solid rgba(212, 168, 67, 0.3);
  box-shadow:
    0 0 60px rgba(100,120,200,0.2),
    0 0 120px rgba(50,60,120,0.1),
    inset 0 -20px 60px rgba(0,0,0,0.5),
    inset 5px 5px 20px rgba(255,255,255,0.05);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.5s;
}

/* Highlight reflex */
.crystal-ball::before {
  content: '';
  position: absolute;
  top: 18%;
  left: 20%;
  width: 30%;
  height: 25%;
  background: radial-gradient(ellipse, rgba(255,255,255,0.18) 0%, transparent 70%);
  border-radius: 50%;
  transform: rotate(-30deg);
}

/* Inner mist */
.crystal-mist {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
}

.mist-particle {
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
  animation: mistFloat var(--mf-dur, 4s) ease-in-out infinite;
  animation-delay: var(--mf-delay, 0s);
  opacity: 0;
}

@keyframes mistFloat {
  0%        { opacity: 0;   transform: translate(0, 20px) scale(0.8); }
  30%, 70%  { opacity: 0.35; }
  100%      { opacity: 0;   transform: translate(10px, -20px) scale(1.2); }
}

/* Orbit rings around ball */
.orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(212,168,67,0.15);
  top: 50%; left: 50%;
  transform: translate(-50%,-50%) rotateX(70deg);
  animation: orbitSpin var(--or-dur, 6s) linear infinite;
}
.orbit-ring:nth-child(1) { width: 240px; height: 240px; --or-dur: 8s; }
.orbit-ring:nth-child(2) { width: 270px; height: 270px; --or-dur: 12s; animation-direction: reverse; opacity: 0.7; }

/* Floating stars around ball */
.ball-star {
  position: absolute;
  width: 4px; height: 4px;
  background: var(--accent-gold);
  border-radius: 50%;
  animation: starOrbit var(--so-dur, 5s) linear infinite;
  box-shadow: 0 0 4px var(--accent-gold);
}

@keyframes starOrbit {
  from { transform: rotate(var(--so-start, 0deg)) translateX(130px) rotate(calc(-1 * var(--so-start, 0deg))); opacity: 0.8; }
  50%  { opacity: 0.3; }
  to   { transform: rotate(calc(var(--so-start, 0deg) + 360deg)) translateX(130px) rotate(calc(-1 * (var(--so-start, 0deg) + 360deg))); opacity: 0.8; }
}

@keyframes orbitSpin {
  from { transform: translate(-50%,-50%) rotateX(70deg) rotateZ(0deg); }
  to   { transform: translate(-50%,-50%) rotateX(70deg) rotateZ(360deg); }
}

/* Crystal Reveal states */
.crystal-ball.state-si      { box-shadow: 0 0 60px var(--si-glow), 0 0 120px rgba(74,222,128,0.2), inset 0 -20px 60px rgba(0,0,0,0.5); }
.crystal-ball.state-no      { box-shadow: 0 0 60px var(--no-glow), 0 0 120px rgba(248,113,113,0.2), inset 0 -20px 60px rgba(0,0,0,0.5); }
.crystal-ball.state-quizas  { box-shadow: 0 0 60px var(--quizas-glow), 0 0 120px rgba(167,139,250,0.2), inset 0 -20px 60px rgba(0,0,0,0.5); }
.crystal-ball.state-si .mist-particle     { background: radial-gradient(circle, rgba(74,222,128,0.6), transparent); }
.crystal-ball.state-no .mist-particle     { background: radial-gradient(circle, rgba(248,113,113,0.6), transparent); }
.crystal-ball.state-quizas .mist-particle { background: radial-gradient(circle, rgba(167,139,250,0.6), transparent); }

/* === PENDULUM ANIMATION === */
.pendulum-wrap {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pendulum {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.4), var(--accent-gold));
  box-shadow: 0 0 16px var(--accent-gold);
  transform-origin: top center;
  animation: pendulumSwing 1.6s ease-in-out infinite;
  display: none;
}

.pendulum.active { display: block; }

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

/* === RESULT DISPLAY === */
.result-display {
  margin-bottom: 28px;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 32px;
  border-radius: 50px;
  font-family: var(--font-title);
  font-size: 1.5rem;
  letter-spacing: 0.1em;
  border: 1px solid;
  position: relative;
  animation: badgeReveal 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes badgeReveal {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}

.result-badge.badge-si {
  color: var(--si-color);
  border-color: var(--si-color);
  background: rgba(74, 222, 128, 0.08);
  box-shadow: 0 0 30px var(--si-glow);
}

.result-badge.badge-no {
  color: var(--no-color);
  border-color: var(--no-color);
  background: rgba(248, 113, 113, 0.08);
  box-shadow: 0 0 30px var(--no-glow);
}

.result-badge.badge-quizas {
  color: var(--quizas-color);
  border-color: var(--quizas-color);
  background: rgba(167, 139, 250, 0.08);
  box-shadow: 0 0 30px var(--quizas-glow);
}

.result-icon { font-size: 1.6rem; }

/* Energy tag */
.energy-tag {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 10px;
  padding: 4px 14px;
  border: 1px solid rgba(212, 168, 67, 0.15);
  border-radius: 20px;
  background: rgba(212, 168, 67, 0.04);
}

/* === INTERPRETATION TEXT === */
.interpretation-box {
  margin-top: 24px;
  padding: 24px 28px;
  border-left: 2px solid var(--accent-gold);
  background: rgba(212, 168, 67, 0.04);
  border-radius: 0 10px 10px 0;
  animation: fadeUp 0.6s ease 0.2s both;
}

.interpretation-title {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 12px;
  opacity: 0.8;
}

.interpretation-text {
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-bright);
  font-style: italic;
}

/* === NEW QUERY BUTTON === */
.new-query-btn {
  margin-top: 28px;
  padding: 13px 28px;
  background: transparent;
  border: 1px solid rgba(212,168,67,0.3);
  border-radius: 8px;
  color: var(--text-mid);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s;
  animation: fadeUp 0.6s ease 0.35s both;
}

.new-query-btn:hover {
  border-color: var(--accent-gold);
  color: var(--accent-amber);
  background: rgba(212,168,67,0.06);
}

/* === LOADING STATE === */
.loading-veil {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 0;
}

.loading-veil.active { display: flex; }

.loading-runes {
  display: flex;
  gap: 8px;
}

.loading-rune {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-gold);
  animation: runePulse 1.2s ease-in-out infinite;
  opacity: 0.3;
}

.loading-rune:nth-child(1) { animation-delay: 0s; }
.loading-rune:nth-child(2) { animation-delay: 0.2s; }
.loading-rune:nth-child(3) { animation-delay: 0.4s; }
.loading-rune:nth-child(4) { animation-delay: 0.6s; }
.loading-rune:nth-child(5) { animation-delay: 0.8s; }

@keyframes runePulse {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50%       { opacity: 1;   transform: scale(1.3); }
}

.loading-text {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  animation: breathe 2s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}

/* === ERROR MESSAGE === */
.error-msg {
  display: none;
  padding: 14px 18px;
  border: 1px solid rgba(248,113,113,0.3);
  border-radius: 8px;
  background: rgba(248,113,113,0.06);
  color: var(--no-color);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  margin-top: 16px;
  animation: fadeUp 0.4s ease both;
}
.error-msg.visible { display: block; }

/* === DECORATIVE DIVIDER === */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0;
  opacity: 0.3;
}

.divider-line { flex: 1; height: 1px; background: var(--accent-gold); }
.divider-gem  { font-size: 0.7rem; color: var(--accent-gold); }

/* === FOOTER TAGLINE === */
.oraculo-footer {
  text-align: center;
  margin-top: 40px;
  animation: fadeUp 0.8s ease 0.4s both;
}

.footer-text {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  opacity: 0.5;
}

/* === ANIMATIONS === */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

/* Particles burst on reveal */
.particle-burst {
  position: absolute;
  top: 50%; left: 50%;
  pointer-events: none;
}

.burst-p {
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: burstAway var(--bp-dur, 0.8s) ease-out both;
}

@keyframes burstAway {
  from { opacity: 1; transform: translate(-50%,-50%) scale(1); }
  to   { opacity: 0; transform: translate(calc(-50% + var(--bp-x, 0px)), calc(-50% + var(--bp-y, 0px))) scale(0.5); }
}

/* === PHASE TRANSITIONS (consulta ↔ resultado) === */

/* El wrapper de la fase de consulta */
#consult-phase {
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Salida: fade + slide up */
#consult-phase.phase-exit,
#consult-btn.phase-exit {
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Entrada: fade + slide up desde abajo */
#consult-phase.phase-enter,
#consult-btn.phase-enter {
  animation: phaseEnter 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

/* El oracle-stage también necesita salida suave */
#oracle-stage.phase-exit {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

/* === PHASE TRANSITIONS (consulta ↔ resultado) === */
@media (max-width: 600px) {
  .oraculo-wrapper   { padding: 24px 14px 60px; }
  .glass-panel       { padding: 22px 18px; }
  .crystal-container { width: 160px; height: 160px; }
  .crystal-ball      { width: 160px; height: 160px; }
  .ball-star         { --tx: 95px !important; }
  .orbit-ring:nth-child(1) { width: 195px; height: 195px; }
  .orbit-ring:nth-child(2) { width: 220px; height: 220px; }
  .result-badge      { font-size: 1.2rem; padding: 11px 22px; }
  .oraculo-title     { font-size: 1.2rem; }
}
