/* ========================================
   YUMELIA Dream Divination Web App
   Based on Fortune Mobile App Theme
   ======================================== */

/* ---------- CSS Variables ---------- */
:root {
  /* Mobile App Theme darkColors */
  --color-bg: #1a1a3a;
  /* midnightBlue */
  --color-bg-dark: #1a1a2e;
  /* deepNavy */
  --color-gold: #daa520;
  /* secondary */
  --color-gold-light: #ffd700;
  /* accent */
  --color-gold-dark: #b8860b;
  /* primary */

  --color-purple: #6b4e9e;
  /* Legacy, keeping for gradients if needed */
  --color-purple-light: #9b7ed9;

  --color-text: #e0e0e0;
  /* primary text */
  --color-text-muted: #c0c0c0;
  /* secondary silver */
  --color-text-dark: #000000;

  --color-glass: rgba(0, 0, 0, 0.3);
  --color-glass-border: rgba(255, 255, 255, 0.05);

  --font-display: "Cinzel", serif;
  --font-body: "Zen Kaku Gothic New", sans-serif;

  --shadow-glow: 0 0 30px rgba(218, 165, 32, 0.2);
  --transition-premium: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Background ---------- */
#starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

.bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: radial-gradient(ellipse at 50% 30%,
      rgba(218, 165, 32, 0.05) 0%,
      transparent 70%);
  /* Changed to slight gold tint */
  pointer-events: none;
}

/* ---------- Custom Cursor ---------- */
.cursor-glow {
  position: fixed;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle,
      rgba(218, 165, 32, 0.1) 0%,
      transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
  display: none;
}

/* ---------- Containers ---------- */
.container {
  width: 90%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-wide {
  max-width: 1200px;
}

/* ---------- Theme Utilities ---------- */
.cinzel {
  font-family: var(--font-display);
}

.text-gold {
  background: linear-gradient(135deg,
      var(--color-gold-light) 0%,
      var(--color-gold) 50%,
      var(--color-gold-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass {
  background: var(--color-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--color-glass-border);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transition: var(--transition-premium);
}

.glass:hover {
  border-color: rgba(218, 165, 32, 0.2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

/* ---------- Header ---------- */
.header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 30px 0;
  z-index: 1000;
  transition: var(--transition-premium);
  /* Allow clicks to pass through empty parts of the header to buttons beneath */
  pointer-events: none;
}

.header .container-wide {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Header Content Layout */
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.header-download {
  display: flex;
  align-items: center;
  gap: 15px;
  pointer-events: auto;
}

.download-text {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  /* Changed from --text-muted to --color-text-muted */
  letter-spacing: 1px;
  font-weight: 500;
}

.header-store-buttons {
  display: flex;
  gap: 10px;
}

.header-store-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-fast);
  /* Changed from --transition to --transition-fast */
  border: 1px solid rgba(255, 255, 255, 0.2);
  /* "Coming Soon" styling */
  opacity: 0.5;
  pointer-events: none;
  cursor: default;
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-muted);
  /* Changed from --text-muted to --color-text-muted */
}

.header-store-btn.ios i {
  font-size: 1rem;
}

.header-store-btn.android i {
  font-size: 0.9rem;
}

/* Base Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
  z-index: 10;
  pointer-events: auto;
}

.logo:hover {
  transform: scale(1.02);
}

.logo-icon {
  font-size: 28px;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

.logo-text {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg,
      #ffe566 0%,
      #ffd700 50%,
      #ffb800 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.7));
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 10px;
  border-radius: 50%;
}

.icon-btn:hover {
  color: var(--color-gold-light);
  background: rgba(255, 255, 255, 0.05);
}

/* ---------- Tabs ---------- */
.mode-tabs-section {
  padding-top: 140px;
  /* Increased from 120px to avoid header overlap */
  position: relative;
  z-index: 100;
}

.mode-tabs {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.mode-tab {
  background: var(--color-glass);
  border: 1px solid var(--color-glass-border);
  color: var(--color-text-muted);
  padding: 15px 40px;
  border-radius: 30px;
  font-size: 16px;
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(10px);
}

.mode-tab:hover {
  color: var(--color-text);
  border-color: rgba(218, 165, 32, 0.3);
}

.mode-tab.active {
  background: rgba(218, 165, 32, 0.15);
  border-color: var(--color-gold);
  color: var(--color-gold-light);
  box-shadow: 0 0 20px rgba(218, 165, 32, 0.2);
}

/* Panels */
.feature-panel {
  display: none;
  opacity: 0;
  animation: fadeIn 0.5s forwards;
  position: relative;
  z-index: 1;
}

.feature-panel.active {
  display: block;
}

/* ---------- Hero ---------- */
.hero {
  padding: 60px 0 40px;
  text-align: center;
}

.hero-title .cinzel {
  font-size: clamp(40px, 8vw, 64px);
  font-weight: 700;
  letter-spacing: 0.15em;
  line-height: 1.2;
  text-shadow: 0 0 30px rgba(218, 165, 32, 0.3);
  display: block;
}

.jp-subtitle {
  font-size: clamp(20px, 5vw, 24px);
  font-weight: 300;
  color: var(--color-text-muted);
  letter-spacing: 0.6em;
  margin-top: 10px;
  display: block;
}

.hero-desc {
  font-size: 16px;
  color: var(--color-text-muted);
  font-weight: 300;
  max-width: 600px;
  margin: 30px auto 0;
  line-height: 1.8;
}

/* ---------- Input Sections ---------- */
.input-section {
  padding-bottom: 80px;
}

.input-card {
  padding: 60px;
  text-align: center;
}

.input-group {
  margin-bottom: 25px;
}

.input-with-action {
  position: relative;
  display: flex;
  align-items: center;
}

.mic-btn {
  position: absolute;
  right: 15px;
  background: rgba(255, 255, 255, 0.05);
  /* Glassmorphic base */
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 5;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.mic-btn-textarea {
  top: 10px;
  right: 15px;
}

.mic-btn:hover {
  background: rgba(218, 165, 32, 0.15);
  /* Gold tint on hover */
  border-color: rgba(218, 165, 32, 0.4);
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(218, 165, 32, 0.3);
}

/* Modern SVG-like abstract mic icon using CSS */
.mic-icon-modern {
  width: 6px;
  height: 14px;
  background: var(--color-gold-light);
  border-radius: 10px;
  position: relative;
  transition: all 0.3s ease;
}

.mic-icon-modern::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -6px;
  width: 18px;
  height: 12px;
  border: 1.5px solid rgba(218, 165, 32, 0.6);
  border-top: none;
  border-radius: 0 0 10px 10px;
  transform: translateY(-20%);
}

.mic-icon-modern::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 2px;
  height: 6px;
  background: rgba(218, 165, 32, 0.6);
  transform: translateX(-50%);
}

.mic-btn.recording {
  background: rgba(218, 165, 32, 0.2);
  border-color: var(--color-gold);
  animation: pulse-gold 1.5s infinite;
}

.mic-btn.recording .mic-icon-modern {
  background: #fff;
}

.mic-btn.recording .mic-icon-modern::before,
.mic-btn.recording .mic-icon-modern::after {
  border-color: #fff;
  background-color: transparent;
}

.mic-btn.recording .mic-icon-modern::after {
  background-color: #fff;
}

@keyframes pulse-gold {
  0% {
    box-shadow: 0 0 0 0 rgba(218, 165, 32, 0.4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(218, 165, 32, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(218, 165, 32, 0);
  }
}

/* Starting state — subtle scale bounce to confirm tap was registered */
.mic-btn.mic-starting {
  background: rgba(218, 165, 32, 0.1);
  border-color: rgba(218, 165, 32, 0.5);
  animation: pulse-gold 0.8s infinite;
  opacity: 0.7;
}

/* Processing state — spinner-like brightness flash */
.mic-btn.mic-processing {
  background: rgba(100, 200, 100, 0.15);
  border-color: rgba(100, 220, 100, 0.5);
  animation: mic-process 0.6s ease infinite alternate;
}

@keyframes mic-process {
  from {
    opacity: 0.5;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1.04);
  }
}

/* Voice toast notification */
#voiceToast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 15, 35, 0.95);
  color: #f0e6c8;
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 13px;
  font-family: var(--font-body);
  z-index: 9999;
  border: 1px solid rgba(218, 165, 32, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  pointer-events: none;
  animation: toastFadeIn 0.2s ease;
}

#voiceToast.toast-error {
  border-color: rgba(220, 80, 80, 0.5);
  background: rgba(40, 10, 10, 0.95);
}

@keyframes toastFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ---------- Custom Date Inputs ---------- */
.date-inputs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.date-part {
  flex: 1;
  text-align: center;
  padding-left: 0 !important;
  padding-right: 0 !important;
  letter-spacing: 0.1em;
}

.date-sep {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.input-row {
  display: flex;
  gap: 20px;
}

.input-row .input-group {
  flex: 1;
}

.input-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-gold);
  margin-bottom: 12px;
  display: block;
  text-align: left;
}

.text-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-glass-border);
  border-radius: 12px;
  padding: 15px 50px 15px 20px;
  /* Right padding for mic button */
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  transition: var(--transition-fast);
  outline: none;
}

.text-input-small {
  padding: 15px 20px;
  font-size: 16px;
}

.textarea-input {
  resize: none;
  padding-right: 50px;
  min-height: 100px;
}

.text-input::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

.text-input:focus {
  background: rgba(0, 0, 0, 0.6);
  border-color: var(--color-gold);
  box-shadow: 0 0 20px rgba(218, 165, 32, 0.15);
}

/* ---------- Chip Options (Dream Divination) ---------- */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 5px;
}

.chip-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  color: var(--color-text-muted);
  padding: 8px 16px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.3s ease;
}

.chip-btn:hover {
  background: rgba(218, 165, 32, 0.15);
  border-color: rgba(218, 165, 32, 0.4);
  color: var(--color-text-main);
}

.chip-btn.active {
  background: rgba(218, 165, 32, 0.25);
  border-color: var(--color-gold-light);
  color: var(--color-gold-light);
  font-weight: 600;
  box-shadow: 0 0 10px rgba(218, 165, 32, 0.2);
}

.fortune-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  padding: 20px 60px;
  font-size: 18px;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-bg-dark);
  /* Dark text for gold background */
  background: linear-gradient(135deg,
      var(--color-gold-light) 0%,
      var(--color-gold) 100%);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: 0 10px 30px rgba(218, 165, 32, 0.3);
}

.fortune-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(218, 165, 32, 0.4);
}

.fortune-btn:active {
  transform: translateY(0);
}

.btn-small {
  padding: 12px 30px;
  font-size: 16px;
}

/* ---------- Result Sections ---------- */
.result-section {
  padding-bottom: 100px;
}

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

.result-card {
  padding: 50px;
  text-align: center;
}

.result-header {
  margin-bottom: 40px;
}

.result-icon {
  display: block;
  font-size: 60px;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 20px rgba(218, 165, 32, 0.5));
}

.result-title {
  font-family: var(--font-display);
  font-size: 28px;
  background: linear-gradient(135deg,
      var(--color-gold-light) 0%,
      var(--color-gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Numerology Result Grid */
.numerology-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  text-align: left;
}

.result-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--color-glass-border);
  border-radius: 16px;
  padding: 25px;
}

.result-box.highlight {
  border-color: rgba(218, 165, 32, 0.5);
  background: rgba(218, 165, 32, 0.05);
}

.box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 10px;
}

.box-title {
  font-size: 12px;
  color: var(--color-gold);
  letter-spacing: 0.1em;
}

.box-number {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--color-gold-light);
  font-weight: 700;
}

.box-content h4 {
  font-size: 14px;
  margin-top: 15px;
  margin-bottom: 5px;
  color: var(--color-text-muted);
}

.box-content p {
  font-size: 15px;
  line-height: 1.6;
}

/* Dream Result Specific (Organic Manuscript Style) */
.divination-manuscript {
  text-align: left;
  margin-top: 30px;
  margin-bottom: 30px;
  padding: 40px;
  background: rgba(10, 15, 36, 0.4);
  border-radius: 20px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(218, 165, 32, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

/* Subtle glowing border using pseudo-element */
.divination-manuscript::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 20px;
  border: 1px solid rgba(218, 165, 32, 0.15);
  pointer-events: none;
}

.manuscript-section {
  margin-bottom: 40px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s ease forwards;
}

.manuscript-section:nth-child(1) {
  animation-delay: 0.2s;
}

.manuscript-section:nth-child(3) {
  animation-delay: 0.6s;
}

.manuscript-section:nth-child(5) {
  animation-delay: 1.0s;
}

.manuscript-section:nth-child(7) {
  animation-delay: 1.4s;
}

.manuscript-section:nth-child(9) {
  animation-delay: 1.8s;
}

/* For footer */

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.manuscript-title {
  font-family: 'Shippori Mincho', serif;
  font-size: 18px;
  color: var(--color-gold);
  text-align: center;
  margin-bottom: 25px;
  font-weight: 500;
  letter-spacing: 0.15em;
}

.manuscript-text {
  font-family: 'Shippori Mincho', serif;
  font-size: 15px;
  line-height: 2.2;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.9);
  text-align: justify;
}

.manuscript-divider {
  text-align: center;
  color: rgba(218, 165, 32, 0.4);
  font-size: 14px;
  letter-spacing: 0.4em;
  margin: 30px 0;
  user-select: none;
}

/* Elegant integration for Lucky Action & Color */
.manuscript-footer {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.manuscript-sigil {
  text-align: center;
  margin-bottom: 15px;
}

.manuscript-sigil i {
  color: var(--color-gold);
  font-size: 24px;
  opacity: 0.7;
}

.manuscript-lucky-detail {
  font-family: 'Shippori Mincho', serif;
  font-size: 15px;
  line-height: 2;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
}

.lucky-highlight {
  color: var(--color-gold-light);
  font-weight: 600;
  margin: 0 5px;
}

.color-highlight {
  font-weight: 600;
  margin: 0 5px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.retry-btn {
  display: inline-block;
  margin-top: 40px;
  padding: 12px 40px;
  font-size: 16px;
  font-family: var(--font-body);
  color: var(--color-gold);
  background: transparent;
  border: 1px solid var(--color-gold);
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.retry-btn:hover {
  background: rgba(218, 165, 32, 0.1);
}

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  transition: var(--transition-fast);
}

.modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-content {
  width: 90%;
  max-width: 500px;
  padding: 40px;
  transform: translateY(0);
  transition: transform 0.3s ease;
}

.modal.hidden .modal-content {
  transform: translateY(20px);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 18px;
  color: var(--color-gold-light);
}

.settings-desc {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 25px;
  line-height: 1.6;
}

.modal-footer {
  text-align: right;
  margin-top: 20px;
}

/* ---------- Loading Overlay ---------- */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(26, 26, 58, 0.9);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(218, 165, 32, 0.2);
  border-top: 3px solid var(--color-gold-light);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

.loading-text {
  color: var(--color-gold);
  font-size: 16px;
  letter-spacing: 0.2em;
  animation: pulse 1.5s infinite;
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 40px 0 20px;
  border-top: 1px solid var(--color-glass-border);
  margin-top: 50px;
}

.footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  text-decoration: none;
  transition: var(--transition-fast);
}

.footer-links a:hover {
  color: var(--color-gold-light);
}

.copyright {
  color: rgba(255, 255, 255, 0.3);
  font-size: 14px;
  letter-spacing: 0.1em;
}

/* ---------- Utility Animations ---------- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Premium Date Picker Modal ---------- */
.date-trigger-btn {
  width: 100%;
  padding: 15px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-glass-border);
  border-radius: 12px;
  color: var(--color-text-main);
  font-size: 1.1rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-premium);
  letter-spacing: 0.1em;
  font-family: var(--font-main);
}

.date-trigger-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(218, 165, 32, 0.4);
  box-shadow: 0 5px 15px rgba(218, 165, 32, 0.15);
}

.date-trigger-btn.has-value {
  color: var(--color-gold-light);
  font-weight: 600;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 25, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.date-picker-card {
  width: 90%;
  max-width: 400px;
  background: linear-gradient(135deg, rgba(30, 30, 60, 0.9), rgba(15, 15, 35, 0.95));
  border: 1px solid var(--color-glass-border);
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  transform: translateY(0) scale(1);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

.modal-overlay.hidden .date-picker-card {
  transform: translateY(30px) scale(0.95);
}

.dp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.dp-header h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--color-gold-light);
  margin: 0;
  letter-spacing: 0.05em;
}

.dp-close {
  color: var(--color-text-muted);
  font-size: 24px;
  padding: 5px;
  line-height: 1;
}

.dp-display {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 1.1rem;
  color: var(--color-text-muted);
}

.dp-val {
  color: var(--color-text-main);
  font-weight: 600;
  font-size: 1.3rem;
  min-width: 40px;
  text-align: right;
  display: inline-block;
  transition: color 0.3s ease;
}

.dp-val.active {
  color: var(--color-gold-light);
  border-bottom: 2px solid var(--color-gold-light);
}

.dp-body {
  flex-grow: 1;
  overflow-y: auto;
  /* Custom scrollbar for webkit */
  scrollbar-width: thin;
  scrollbar-color: var(--color-gold-light) rgba(255, 255, 255, 0.05);
  padding-right: 5px;
}

.dp-body::-webkit-scrollbar {
  width: 6px;
}

.dp-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.dp-body::-webkit-scrollbar-thumb {
  background: var(--color-gold-light);
  border-radius: 10px;
}

.number-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding-bottom: 10px;
}

.number-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--color-text-main);
  padding: 15px 0;
  font-size: 1.1rem;
  font-weight: 500;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.number-btn:hover,
.number-btn:active {
  background: rgba(218, 165, 32, 0.15);
  border-color: var(--color-gold-main);
  color: var(--color-gold-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

  .mode-tabs-section {
    padding-top: 190px;
  }

  .header-content {
    flex-direction: column;
    gap: 15px;
  }

  .logo-icon {
    font-size: 24px;
  }

  .logo-text {
    font-size: 24px;
  }

  .header-download {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .download-text {
    width: 100%;
    text-align: center;
    margin-bottom: 5px;
  }

  .header-store-buttons {
    width: 100%;
    justify-content: center;
  }

  .hero-title .cinzel {
    font-size: 2.2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
    padding: 0 5px;
  }

  .mode-tabs {
    flex-direction: row;
    gap: 10px;
    padding: 0 5px;
  }

  .mode-tab {
    padding: 12px 20px;
    font-size: 14px;
    width: 50%;
    justify-content: center;
  }

  .input-card,
  .result-card {
    padding: 25px 10px;
    border-radius: 15px;
  }

  .input-row {
    flex-direction: column;
    gap: 15px;
  }

  .input-group,
  .select-group {
    width: 100%;
  }

  .action-btn {
    min-height: 50px;
    font-size: 16px;
  }

  .hero {
    padding: 40px 0 20px;
  }

  /* Responsive Organic Manuscript UI */
  .divination-manuscript {
    padding: 25px 15px;
    border-radius: 15px;
    margin-top: 20px;
    margin-bottom: 20px;
  }

  .manuscript-title {
    font-size: 16px;
    margin-bottom: 20px;
    letter-spacing: 0.1em;
  }

  .manuscript-text {
    font-size: 14.5px;
    line-height: 2;
    letter-spacing: 0.05em;
  }

  .manuscript-divider {
    margin: 20px 0;
  }

  .manuscript-footer {
    margin-top: 30px;
    padding-top: 25px;
  }
}

/* ---------- Color Chip Specific Styles ---------- */
.color-chip {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, border-color 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  overflow: hidden;
}

.color-chip:hover {
  transform: scale(1.15);
  z-index: 2;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.color-chip.active {
  transform: scale(1.1);
  border-color: var(--color-gold-light);
  box-shadow: 0 0 20px var(--color-gold-light);
}

.color-chip.active::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 18px;
  font-weight: bold;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
}

/* Specific Colors */
.color-chip[data-color="red"] {
  background: linear-gradient(135deg, #ff4d4d, #b30000);
}

.color-chip[data-color="blue"] {
  background: linear-gradient(135deg, #4d94ff, #0052cc);
}

.color-chip[data-color="yellow"] {
  background: linear-gradient(135deg, #ffff4d, #e6e600);
}

.color-chip[data-color="green"] {
  background: linear-gradient(135deg, #4dff4d, #009900);
}

.color-chip[data-color="white"] {
  background: linear-gradient(135deg, #ffffff, #cccccc);
}

.color-chip[data-color="black"] {
  background: linear-gradient(135deg, #333333, #000000);
  border-color: rgba(255, 255, 255, 0.4);
}

.color-chip[data-color="gold-silver"] {
  background: linear-gradient(135deg, #ffd700, #c0c0c0);
}

/* Adjust "None" button specifically for consistency */
.tip-btn {
  border-radius: 20px;
  min-width: 60px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- SEO: h1 in Logo ---------- */
h1.logo-text {
  font-family: var(--font-display);
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
  padding: 0;
  display: inline;
  background: inherit;
  -webkit-background-clip: inherit;
  background-clip: inherit;
  -webkit-text-fill-color: inherit;
  color: inherit;
}

/* ---------- FAQ Section ---------- */
.faq-section {
  padding: 80px 0 40px;
  position: relative;
}

.faq-heading {
  font-family: 'Shippori Mincho', serif;
  font-size: 1.6rem;
  color: var(--color-gold);
  text-align: center;
  margin-bottom: 40px;
  letter-spacing: 0.15em;
  font-weight: 500;
}

.faq-icon {
  display: inline-block;
  margin: 0 10px;
  opacity: 0.6;
  font-size: 0.9em;
}

.faq-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-glass-border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.faq-item:hover {
  border-color: rgba(218, 165, 32, 0.3);
}

.faq-item[open] {
  border-color: rgba(218, 165, 32, 0.4);
  box-shadow: 0 4px 20px rgba(218, 165, 32, 0.08);
}

.faq-question {
  padding: 18px 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-main);
  list-style: none;
  transition: background 0.3s ease;
  user-select: none;
}

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

.faq-question::after {
  content: '+';
  margin-left: auto;
  font-size: 1.3rem;
  color: var(--color-gold);
  font-weight: 300;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.faq-item[open] .faq-question::after {
  content: '−';
}

.faq-question:hover {
  background: rgba(218, 165, 32, 0.05);
}

.faq-q-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(218, 165, 32, 0.2), rgba(218, 165, 32, 0.1));
  color: var(--color-gold-light);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0;
  flex-shrink: 0;
}

.faq-answer {
  padding: 0 24px 20px;
  animation: faqFadeIn 0.3s ease;
}

.faq-answer p {
  font-size: 0.95rem;
  line-height: 1.9;
  color: var(--color-text-muted);
  margin: 0;
  padding-left: 42px;
}

@keyframes faqFadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .faq-question {
    padding: 16px 18px;
    font-size: 0.95rem;
    gap: 10px;
  }

  .faq-answer p {
    padding-left: 38px;
    font-size: 0.9rem;
  }

  .faq-heading {
    font-size: 1.3rem;
  }
}

/* ---------- Microphone Permission Guidance Modal ---------- */
.mic-guidance-card {
  max-width: 500px !important;
  text-align: center;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.mic-guidance-body {
  padding: 30px 20px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.guidance-icon {
  font-size: 50px;
  color: #ff4d4d;
  /* High contrast red for blocked status */
  margin-bottom: 20px;
  filter: drop-shadow(0 0 15px rgba(255, 77, 77, 0.3));
}

.guidance-desc {
  font-size: 15px;
  line-height: 1.8;
  color: var(--color-text);
  margin-bottom: 30px;
}

.browser-instructions {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  text-align: left;
  margin-bottom: 30px;
}

.instruction-item {
  margin-bottom: 15px;
}

.instruction-item:last-child {
  margin-bottom: 0;
}

.browser-name {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-gold);
  margin-bottom: 5px;
  letter-spacing: 0.05em;
}

.instruction-item p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.instruction-item i {
  margin: 0 4px;
  color: var(--color-text);
}

#micUnderstandBtn {
  margin-top: 10px;
  margin-bottom: 5px;
}

/* ---------- Advertisement Styling ---------- */
.ad-container-result {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ad-container-faq {
  margin-top: 40px;
  padding: 20px;
  background: var(--color-glass);
  border-radius: 16px;
  border: 1px solid var(--color-glass-border);
  min-height: 100px;
  width: 100%;
  display: block;
  position: relative;
}

/* ---------- Header Nav ---------- */
.header-nav {
  display: flex;
  gap: 25px;
  margin: 0 30px;
}

.nav-link {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition-fast);
  letter-spacing: 0.05em;
}

.nav-link:hover {
  color: var(--color-gold-light);
}

@media (max-width: 1024px) {
  .header-nav {
    display: none; /* Hide on small screens to avoid overlap */
  }
}

/* ========================================
   Content Sections Styling (For AdSense)
   ======================================== */
.content-section {
  padding: 80px 0;
  border-top: 1px solid var(--color-glass-border);
}

.content-section-title {
  font-family: var(--font-display);
  font-size: 32px;
  text-align: center;
  margin-bottom: 50px;
  color: var(--color-gold-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.section-icon {
  font-size: 40px;
  margin-bottom: 5px;
  filter: drop-shadow(0 0 10px rgba(218, 165, 32, 0.4));
}

.section-subtitle {
  font-size: 14px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--color-gold);
  opacity: 0.8;
}

.content-card {
  padding: 40px;
  margin-bottom: 30px;
  border-radius: 20px;
}

.content-heading {
  font-family: 'Shippori Mincho', serif;
  font-size: 22px;
  color: var(--color-gold);
  margin-bottom: 20px;
  border-left: 4px solid var(--color-gold);
  padding-left: 15px;
}

.content-sub-heading {
  font-family: 'Shippori Mincho', serif;
  font-size: 24px;
  color: var(--color-gold-light);
  text-align: center;
  margin: 60px 0 40px;
}

.content-text {
  font-size: 16px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 15px;
}

.inline-link {
  color: var(--color-gold-light);
  text-decoration: underline;
  transition: opacity 0.2s;
}

.inline-link:hover {
  opacity: 0.8;
}

/* Symbol Grid */
.symbol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-bottom: 50px;
}

.symbol-card {
  padding: 30px;
  border-radius: 16px;
  transition: transform 0.3s ease;
}

.symbol-card:hover {
  transform: translateY(-5px);
  border-color: rgba(218, 165, 32, 0.3);
}

.symbol-emoji {
  font-size: 32px;
  margin-bottom: 15px;
  display: block;
}

.symbol-title {
  font-family: 'Shippori Mincho', serif;
  font-size: 18px;
  color: var(--color-gold-light);
  margin-bottom: 12px;
}

.symbol-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

/* Tips List */
.tips-list {
  display: flex;
  flex-direction: column;
  gap: 25px;
  margin-top: 30px;
}

.tip-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.tip-number {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--color-gold);
  opacity: 0.5;
  line-height: 1;
  padding-top: 5px;
}

.tip-title {
  font-size: 18px;
  color: var(--color-gold-light);
  margin-bottom: 5px;
}

.tip-desc {
  font-size: 14px;
  color: var(--color-text-muted);
}

/* Number Meaning Grid */
.number-meaning-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin-bottom: 50px;
}

.number-meaning-card {
  padding: 30px;
  border-radius: 16px;
  text-align: center;
}

.meaning-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.meaning-icon {
  font-size: 32px;
}

.meaning-header h4 {
  font-family: 'Shippori Mincho', serif;
  font-size: 20px;
  color: var(--color-gold-light);
}

.meaning-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-gold);
  margin-bottom: 15px;
}

.meaning-desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text-muted);
}

/* Number List */
.number-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

.number-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px;
}

.num-badge {
  width: 36px;
  height: 36px;
  background: rgba(218, 165, 32, 0.2);
  border: 1px solid var(--color-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  color: var(--color-gold-light);
  flex-shrink: 0;
}

.num-meaning {
  font-size: 13px;
  color: var(--color-text-muted);
}

.num-badge.master-badge {
  background: rgba(255, 215, 0, 0.3);
  border-color: var(--color-gold-light);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* How to Use Grid */
.howto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.howto-card {
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
}

.howto-header {
  padding: 20px;
  background: rgba(218, 165, 32, 0.1);
  text-align: center;
  border-bottom: 1px solid var(--color-glass-border);
}

.howto-badge {
  display: inline-block;
  padding: 5px 20px;
  background: var(--color-gold);
  color: var(--color-bg-dark);
  border-radius: 50px;
  font-weight: 700;
  font-size: 14px;
}

.howto-badge.numerology-badge {
  background: var(--color-gold-light);
}

.howto-steps {
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.howto-step {
  display: flex;
  gap: 20px;
}

.step-num {
  width: 28px;
  height: 28px;
  background: var(--color-gold);
  color: var(--color-bg-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.howto-step h4 {
  font-size: 16px;
  color: var(--color-gold-light);
  margin-bottom: 5px;
}

.howto-step p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.pwa-info {
  background: rgba(218, 165, 32, 0.05);
  border-color: rgba(218, 165, 32, 0.2);
}

/* About Grid */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
}

@media (max-width: 768px) {
  .content-section {
    padding: 60px 0;
  }
  
  .content-section-title {
    font-size: 26px;
  }
  
  .content-card {
    padding: 25px;
  }
  
  .symbol-grid {
    grid-template-columns: 1fr;
  }
  
  .number-meaning-grid {
    grid-template-columns: 1fr;
  }
  
  .howto-grid {
    grid-template-columns: 1fr;
  }
}