/* ============================================================
   Hexagrama de Nacimiento — estilos
   Paleta: gold #d4af37 sobre dark #0b0c1b (de pakuafun)
   Tipografía: Noto Serif SC + Noto Serif
   ============================================================ */

:root {
  --bg:          #0b0c1b;
  --bg-card:     #111228;
  --bg-input:    #161836;
  --border:      #1e2048;
  --text:        #e8e1d5;
  --text-muted:  #8a8577;
  --gold:        #d4af37;
  --gold-dim:    rgba(212, 175, 55, 0.25);
  --gold-glow:   rgba(212, 175, 55, 0.12);
  --red-soft:    #c45c5c;
  --font-serif:  'Noto Serif', Georgia, serif;
  --font-cn:     'Noto Serif SC', 'Noto Serif', serif;
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-serif);
  line-height: 1.7;
  min-height: 100dvh;
}

a {
  color: var(--gold);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ---- Layout ---- */

.container {
  max-width: 560px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
}

/* ---- Header ---- */

.header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.title-chinese {
  font-family: var(--font-cn);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.title-text {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 28rem;
  margin: 0 auto;
}

/* ---- Form ---- */

.form-section {
  margin-bottom: 2rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}

.form-group input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: var(--gold);
}

/* Color scheme fix for date/time inputs */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7) sepia(0.5) hue-rotate(10deg);
}

/* ---- Method selector ---- */

.method-selector {
  margin-bottom: 1.5rem;
}

.method-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.method-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.method-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.7rem 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  font-family: var(--font-serif);
}

.method-tab:hover {
  border-color: var(--gold-dim);
  color: var(--text);
}

.method-tab.active {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-glow);
}

.method-tab-chinese {
  font-family: var(--font-cn);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.2;
}

.method-tab-name {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

/* ---- Submit ---- */

.submit-btn {
  width: 100%;
  padding: 0.8rem;
  background: var(--gold);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: opacity 0.2s;
}

.submit-btn:hover {
  opacity: 0.88;
}

.submit-btn:active {
  opacity: 0.75;
}

/* ---- Results ---- */

.results-section {
  padding-top: 1rem;
  animation: fadeIn 0.5s var(--ease-out);
}

.results-section.hidden {
  display: none;
}

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

/* Chinese data */

.chinese-data {
  margin-bottom: 2rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.chinese-data h3 {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.6rem;
}

.chinese-data-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.35rem 1.5rem;
  font-size: 0.85rem;
}

.chinese-data-grid .cd-label {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.chinese-data-grid .cd-value {
  font-family: var(--font-cn);
}

/* ---- Hexagram card ---- */

.hexagram-card {
  text-align: center;
  padding: 1.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
}

.hexagram-card-label {
  position: absolute;
  top: -0.55rem;
  left: 1.25rem;
  background: var(--bg-card);
  padding: 0 0.5rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.hexagram-header {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.hexagram-number {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hexagram-unicode {
  font-size: 2rem;
  color: var(--gold);
  line-height: 1;
}

.hexagram-chinese {
  font-family: var(--font-cn);
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.hexagram-pinyin {
  font-size: 1rem;
  font-style: italic;
  color: var(--text-muted);
}

.hexagram-english {
  font-size: 0.95rem;
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
}

.hexagram-trigrams {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.hexagram-trigrams .tri-symbol {
  font-size: 1.1rem;
  color: var(--gold);
  vertical-align: -1px;
}

/* Hexagram lines */

.hexagram-lines {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0.5rem 0;
}

.hex-line {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 8px;
  width: 120px;
  position: relative;
}

.hex-line.yang {
  background: var(--gold);
  border-radius: 2px;
}

.hex-line.yin {
  background: transparent;
}

.hex-line.yin::before,
.hex-line.yin::after {
  content: '';
  display: block;
  width: 50px;
  height: 8px;
  background: var(--gold);
  border-radius: 2px;
}

.hex-line.yin::before { margin-right: 16px; }
.hex-line.yin::after  { margin-left: 0; }

.hex-line.mutating {
  position: relative;
}

.hex-line.mutating::after {
  position: absolute;
  right: -28px;
  font-size: 0.65rem;
  color: var(--red-soft);
  width: auto;
  height: auto;
  background: none;
  border-radius: 0;
  margin: 0;
}

.hex-line.yang.mutating::after {
  content: '\25C0';
  position: absolute;
  right: -28px;
}

.hex-line.yin.mutating .mut-marker {
  position: absolute;
  right: -28px;
  font-size: 0.65rem;
  color: var(--red-soft);
}

.hexagram-mutating-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* Arrow divider */

.arrow-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.75rem 0;
  color: var(--text-muted);
}

.arrow-divider.hidden {
  display: none;
}

.arrow-line-number {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---- Reading ---- */

.reading-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.reading-text {
  font-size: 0.92rem;
  line-height: 1.8;
}

.reading-text h2 {
  font-size: 1rem;
  color: var(--gold);
  margin-top: 1.5rem;
  margin-bottom: 0.4rem;
}

.reading-text h2:first-child {
  margin-top: 0;
}

.reading-text p {
  margin-bottom: 0.8rem;
}

.reading-text strong {
  color: var(--gold);
  font-weight: 600;
}

.reading-text hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}

/* Method note */

.method-note {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--gold-glow);
  border-radius: 8px;
  line-height: 1.6;
}

/* ---- Footer ---- */

.footer {
  text-align: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ---- Manual section ---- */

.manual-section {
  margin-top: 2rem;
  animation: fadeIn 0.5s var(--ease-out);
}

.manual-section.hidden {
  display: none;
}

.manual-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.manual-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.manual-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 26rem;
  margin: 0 auto;
}

.manual-reference {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.manual-reference-title {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.manual-reference-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
  font-size: 0.82rem;
}

.manual-reference-grid span {
  font-family: var(--font-cn);
  white-space: nowrap;
}

.manual-inputs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.manual-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  text-align: center;
}

.manual-back {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.82rem;
}

/* ---- Responsive ---- */

@media (max-width: 480px) {
  .container {
    padding: 2rem 1rem 1.5rem;
  }
  .title-chinese {
    font-size: 2rem;
  }
  .title-text {
    font-size: 1.15rem;
  }
  .hexagram-chinese {
    font-size: 1.6rem;
  }
  .hexagram-unicode {
    font-size: 1.6rem;
  }
}
