@import "tailwindcss";

/* ============================================
   Tử Vi Số · Design Tokens
   Mood: Truyền thống cao cấp · Á Đông · Quiet luxury
   ============================================ */

@theme {
  /* Brand colors */
  --color-brand-red: #a52a2a;
  --color-brand-red-deep: #6b1212;
  --color-brand-red-light: #c03a3a;
  --color-brand-gold: #d4af37;
  --color-brand-gold-soft: #c9a961;
  --color-brand-gold-deep: #b8860b;
  --color-brand-cream: #f5edd8;

  /* Surfaces — dark first */
  --color-bg-base: #0a0808;
  --color-bg-elevated: #171010;
  --color-bg-overlay: #211616;
  --color-bg-inset: #0f0a0a;

  /* Ink (text) */
  --color-ink-primary: #f5edd8;
  --color-ink-secondary: #c4b896;
  --color-ink-muted: #9a8770; /* lifted from #8A7860 for AA contrast */

  /* Strokes */
  --color-stroke-subtle: #2a1f1f;
  --color-stroke-default: #3d2d2d;
  --color-stroke-strong: #6b5230;

  /* Type families */
  --font-display: var(--font-display), serif;
  --font-body: var(--font-body), system-ui, sans-serif;
  --font-numeral: var(--font-numeral), serif;

  /* Container */
  --container-3xl: 1200px;
}

/* ============================================
   Base styles
   ============================================ */

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  background: var(--color-bg-base);
  color: var(--color-ink-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Bagua decorative background utility */
.bagua-decor {
  background-image:
    radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(165, 42, 42, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 60% 80%, rgba(212, 175, 55, 0.05) 0%, transparent 50%);
}

/* Gold sheen text effect */
.text-gold-sheen {
  background: linear-gradient(
    120deg,
    #d4af37 0%,
    #f5e0a0 30%,
    #d4af37 50%,
    #b8860b 70%,
    #d4af37 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sheen 6s ease-in-out infinite;
}

/* Subtle gold border + glow on hover */
.border-gold-glow {
  border: 1px solid rgba(212, 175, 55, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(245, 224, 160, 0.05),
    0 0 0 1px rgba(212, 175, 55, 0.05);
  transition:
    border-color 200ms ease,
    box-shadow 200ms ease;
}

.border-gold-glow:hover {
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(245, 224, 160, 0.08),
    0 0 24px rgba(212, 175, 55, 0.1),
    0 0 0 1px rgba(212, 175, 55, 0.15);
}

/* Ornament line decoration around eyebrows */
.ornament-line::before,
.ornament-line::after {
  content: "";
  display: inline-block;
  width: 32px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-stroke-strong), transparent);
  vertical-align: middle;
  margin: 0 16px;
}

/* Lá số chart cell */
.palace-cell {
  background: rgba(23, 16, 16, 0.6);
  border: 1px solid var(--color-stroke-subtle);
  transition:
    border-color 200ms ease,
    background-color 200ms ease;
}

.palace-cell:hover {
  border-color: var(--color-brand-gold);
  background: rgba(33, 22, 22, 0.8);
}

/* Animations */
@keyframes pulse-soft {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes float-slow {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes sheen {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@utility animate-pulse-soft {
  animation: pulse-soft 4s ease-in-out infinite;
}
@utility animate-float-slow {
  animation: float-slow 8s ease-in-out infinite;
}
@utility animate-sheen {
  animation: sheen 6s ease-in-out infinite;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg-base);
}
::-webkit-scrollbar-thumb {
  background: var(--color-stroke-subtle);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-stroke-default);
}

/* Hide scrollbar utility for tab strips */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--color-brand-gold);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background: var(--color-brand-gold);
  color: var(--color-bg-base);
}
