/*
Theme Name: RichBerD89 — ซินแสอ้วน โหรา
Theme URI: https://richberd89.com
Author: ซินแสอ้วน โหรา (อ.ณัฐ)
Author URI: https://richberd89.com
Description: Custom WordPress theme for RichBerD89 — เบอร์มงคล ศาสตร์ตัวเลข ญาณดูดวง
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: Private
Text Domain: richberd89
*/

/* ─── ROOT VARIABLES ─── */
:root {
  --gold: #C9A84C;
  --gold-light: #F0D080;
  --gold-dark: #8B6914;
  --deep: #0D0A1A;
  --deep2: #160F2E;
  --mid: #1E1540;
  --accent: #6B3FA0;
  --accent2: #9B59D0;
  --cream: #F8F0DC;
  --text: #E8DFC8;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background-color: var(--deep);
  color: var(--text);
  font-family: 'Noto Serif Thai', serif;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 15%, rgba(255,255,200,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 75% 25%, rgba(255,255,200,0.6) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 45% 60%, rgba(255,255,200,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 70%, rgba(255,255,200,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 10% 80%, rgba(255,255,200,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 10%, rgba(255,255,200,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 90%, rgba(255,255,200,0.4) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 90% 45%, rgba(255,255,200,0.6) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* ─── NAVIGATION ─── */
#masthead {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  padding: 1.2rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(13,10,26,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(201,168,76,0.15);
}

.site-logo-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.site-logo-img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  transition: transform 0.35s ease, filter 0.35s ease;
  filter: drop-shadow(0 0 8px rgba(201,168,76,0.5));
}

.site-logo-link:hover .site-logo-img {
  transform: rotate(15deg) scale(1.06);
  filter: drop-shadow(0 0 18px rgba(201,168,76,0.85));
}

.site-logo-text {
  font-family: 'Playfair Display', 'Noto Serif Thai', serif;
  font-weight: 700;
  font-size: 1.15rem;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.06em;
}

#masthead .custom-logo-link img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  filter: drop-shadow(0 0 8px rgba(201,168,76,0.5));
  transition: transform 0.35s ease, filter 0.35s ease;
}
#masthead .custom-logo-link:hover img {
  transform: rotate(15deg) scale(1.06);
  filter: drop-shadow(0 0 18px rgba(201,168,76,0.85));
}

.main-navigation ul {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.main-navigation ul li a {
  color: rgba(232,223,200,0.7);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}
.main-navigation ul li a:hover { color: var(--gold); }

.nav-member-btns {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.nav-btn {
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  font-family: 'Noto Serif Thai', serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s;
}

.nav-btn-login {
  border: 1px solid rgba(201,168,76,0.5);
  color: var(--gold);
  background: transparent;
}
.nav-btn-login:hover { background: rgba(201,168,76,0.1); }

.nav-btn-register {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--deep);
  border: none;
}
.nav-btn-register:hover { box-shadow: 0 4px 20px rgba(201,168,76,0.5); transform: translateY(-2px); }

/* ─── HERO ─── */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  overflow: hidden;
}

#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(107,63,160,0.35) 0%, transparent 70%),
    radial-gradient(ellipse 60% 80% at 20% 80%, rgba(201,168,76,0.15) 0%, transparent 60%);
  z-index: 0;
}

.mandala-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(201,168,76,0.15);
  animation: rotate-slow linear infinite;
}
.mandala-ring:nth-child(1) { width: 500px; height: 500px; animation-duration: 60s; }
.mandala-ring:nth-child(2) { width: 700px; height: 700px; border-color: rgba(201,168,76,0.08); animation-duration: 90s; animation-direction: reverse; }
.mandala-ring:nth-child(3) { width: 900px; height: 900px; border-color: rgba(107,63,160,0.1); animation-duration: 120s; }

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

.hero-content {
  position: relative;
  z-index: 2;
  animation: fadeInUp 1.2s ease both;
}

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

.eyebrow {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--gold);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  opacity: 0.85;
}

.hero-name {
  font-family: 'Noto Serif Thai', serif;
  font-weight: 900;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 1.1;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 40%, var(--gold-dark) 80%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.3rem;
  filter: drop-shadow(0 0 30px rgba(201,168,76,0.4));
}

.hero-sub {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 300;
  color: var(--accent2);
  margin-bottom: 0.5rem;
  letter-spacing: 0.1em;
}

.hero-tagline {
  font-size: 1rem;
  color: rgba(232,223,200,0.6);
  font-weight: 300;
  letter-spacing: 0.2em;
  margin-bottom: 2.5rem;
}

.hero-desc {
  max-width: 500px;
  margin: 0 auto 2rem;
  font-weight: 300;
  line-height: 1.9;
  color: rgba(232,223,200,0.7);
  font-size: 1.05rem;
}

.divider-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem auto;
  color: var(--gold);
  font-size: 1.4rem;
  opacity: 0.7;
}
.divider-ornament::before, .divider-ornament::after {
  content: '';
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ─── BUTTONS ─── */
.btn-primary {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light));
  color: var(--deep);
  font-family: 'Noto Serif Thai', serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.1em;
  border-radius: 50px;
  text-decoration: none;
  box-shadow: 0 8px 30px rgba(201,168,76,0.4), inset 0 1px 0 rgba(255,255,255,0.3);
  transition: all 0.3s ease;
  margin: 0.5rem;
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 15px 40px rgba(201,168,76,0.6); }

.btn-outline {
  display: inline-block;
  padding: 1rem 2.5rem;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: 'Noto Serif Thai', serif;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.1em;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.3s ease;
  margin: 0.5rem;
  backdrop-filter: blur(4px);
  background: rgba(201,168,76,0.05);
}
.btn-outline:hover { background: rgba(201,168,76,0.15); transform: translateY(-3px); }

/* ─── SECTIONS ─── */
.site-section {
  position: relative;
  z-index: 1;
  padding: 6rem 2rem;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
}

.section-label {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--gold);
  font-size: 0.95rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
  display: block;
  text-align: center;
}

.section-title {
  font-family: 'Noto Serif Thai', serif;
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3rem);
  text-align: center;
  margin-bottom: 1rem;
  color: var(--cream);
}

.section-desc {
  text-align: center;
  color: rgba(232,223,200,0.65);
  font-weight: 300;
  font-size: 1.05rem;
  line-height: 1.9;
  max-width: 600px;
  margin: 0 auto 3.5rem;
}

/* ─── ABOUT ─── */
#about { background: linear-gradient(180deg, transparent 0%, rgba(22,15,46,0.8) 50%, transparent 100%); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 4rem;
  align-items: center;
}

.about-avatar {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--deep2) 50%, var(--gold-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  position: relative;
  box-shadow: 0 0 60px rgba(107,63,160,0.4), 0 0 120px rgba(201,168,76,0.15);
  margin: 0 auto;
}

.about-avatar::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px solid rgba(201,168,76,0.3);
}
.about-avatar::after {
  content: '';
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  border: 1px dashed rgba(201,168,76,0.15);
}

.about-text h3 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 1rem;
}
.about-text p {
  font-weight: 300;
  line-height: 2;
  color: rgba(232,223,200,0.75);
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

.badge-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.5rem; }
.badge {
  padding: 0.4rem 1rem;
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 50px;
  font-size: 0.85rem;
  color: var(--gold);
  background: rgba(201,168,76,0.05);
}

/* ─── FEATURES ─── */
#features { background: rgba(22,15,46,0.5); }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: rgba(30,21,64,0.6);
  border: 1px solid rgba(201,168,76,0.12);
  border-radius: 16px;
  padding: 2rem 1.8rem;
  text-align: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.feature-card:hover { transform: translateY(-6px); border-color: rgba(201,168,76,0.3); }
.feature-card:hover::before { opacity: 1; }
.feature-icon { font-size: 2.8rem; margin-bottom: 1rem; display: block; }
.feature-card h4 { font-size: 1.1rem; font-weight: 700; color: var(--gold-light); margin-bottom: 0.8rem; }
.feature-card p { font-size: 0.95rem; font-weight: 300; line-height: 1.8; color: rgba(232,223,200,0.65); }

/* ─── SERVICES ─── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.service-card {
  background: linear-gradient(135deg, rgba(30,21,64,0.8) 0%, rgba(13,10,26,0.9) 100%);
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.service-card:hover { transform: translateY(-5px); border-color: rgba(201,168,76,0.35); }
.service-num {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  font-weight: 700;
  color: rgba(201,168,76,0.15);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.service-card h4 { font-size: 1.2rem; font-weight: 700; color: var(--gold-light); margin-bottom: 0.8rem; }
.service-card p { font-size: 0.95rem; font-weight: 300; line-height: 1.9; color: rgba(232,223,200,0.65); }

/* ─── FREE READING BANNER ─── */
#free-reading { text-align: center; }
.banner-box {
  background: linear-gradient(135deg, rgba(107,63,160,0.3) 0%, rgba(22,15,46,0.8) 50%, rgba(201,168,76,0.1) 100%);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 24px;
  padding: 4rem 3rem;
  position: relative;
  overflow: hidden;
  max-width: 800px;
  margin: 0 auto;
}
.banner-box h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 900; color: var(--cream); margin-bottom: 1rem; }
.banner-box p { font-size: 1.05rem; font-weight: 300; color: rgba(232,223,200,0.7); line-height: 1.9; margin-bottom: 2rem; max-width: 500px; margin-left: auto; margin-right: auto; }
.free-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--deep);
  font-weight: 900;
  font-size: 0.85rem;
  padding: 0.3rem 1rem;
  border-radius: 50px;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
}

/* ─── CONTACT ─── */
#contact { background: rgba(22,15,46,0.5); }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.contact-card {
  background: rgba(30,21,64,0.6);
  border: 1px solid rgba(201,168,76,0.12);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s;
}
.contact-card:hover { border-color: rgba(201,168,76,0.4); transform: translateY(-4px); }
.contact-icon { font-size: 2.2rem; margin-bottom: 0.8rem; }
.contact-card h4 { font-size: 0.9rem; color: var(--gold); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.5rem; }
.contact-card p, .contact-card a { font-size: 1.05rem; font-weight: 600; color: var(--cream); text-decoration: none; }
.contact-card a:hover { color: var(--gold); }

/* ─── MEMBER MODAL ─── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13,10,26,0.9);
  backdrop-filter: blur(10px);
  z-index: 99999;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }

.modal-box {
  background: linear-gradient(135deg, var(--deep2), var(--mid));
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  width: 90%;
  max-width: 460px;
  position: relative;
  animation: fadeInUp 0.4s ease;
}

.modal-close {
  position: absolute;
  top: 1rem; right: 1.5rem;
  font-size: 1.5rem;
  color: rgba(232,223,200,0.5);
  cursor: pointer;
  background: none;
  border: none;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--gold); }

.modal-logo {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.modal-title {
  text-align: center;
  font-weight: 900;
  font-size: 1.6rem;
  color: var(--gold-light);
  margin-bottom: 0.3rem;
}

.modal-subtitle {
  text-align: center;
  font-size: 0.9rem;
  color: rgba(232,223,200,0.5);
  margin-bottom: 2rem;
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid rgba(201,168,76,0.2);
  margin-bottom: 1.8rem;
}

.modal-tab {
  flex: 1;
  padding: 0.7rem;
  text-align: center;
  font-family: 'Noto Serif Thai', serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(232,223,200,0.4);
  cursor: pointer;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s;
}
.modal-tab.active { color: var(--gold); border-bottom-color: var(--gold); }

.modal-form { display: none; }
.modal-form.active { display: block; }

.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-size: 0.85rem; color: var(--gold); margin-bottom: 0.4rem; letter-spacing: 0.05em; }
.form-group input, .form-group select {
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(13,10,26,0.6);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 10px;
  color: var(--cream);
  font-family: 'Noto Serif Thai', serif;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--gold); }

.form-submit {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--deep);
  font-family: 'Noto Serif Thai', serif;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 0.5rem;
}
.form-submit:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(201,168,76,0.4); }

.form-message {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  text-align: center;
  display: none;
}
.form-message.success { background: rgba(0,200,100,0.15); border: 1px solid rgba(0,200,100,0.3); color: #4dffaa; }
.form-message.error { background: rgba(255,80,80,0.15); border: 1px solid rgba(255,80,80,0.3); color: #ff9999; }

/* ─── MEMBER DASHBOARD ─── */
.member-dashboard {
  padding: 8rem 2rem 4rem;
  min-height: 100vh;
}

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

.dashboard-card {
  background: rgba(30,21,64,0.6);
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.dashboard-card h3 {
  color: var(--gold-light);
  font-size: 1.2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(201,168,76,0.1);
}

/* ─── FLOATING NUMS ─── */
.floating-nums {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.fnum {
  position: absolute;
  font-family: 'Playfair Display', serif;
  font-size: 4rem;
  font-weight: 700;
  color: rgba(201,168,76,0.04);
  animation: float-num linear infinite;
  white-space: nowrap;
}
@keyframes float-num {
  from { transform: translateY(110vh) rotate(-10deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  to { transform: translateY(-10vh) rotate(10deg); opacity: 0; }
}

/* ─── FOOTER ─── */
#colophon {
  background: rgba(13,10,26,0.95);
  border-top: 1px solid rgba(201,168,76,0.1);
  text-align: center;
  padding: 2.5rem;
  font-size: 0.9rem;
  color: rgba(232,223,200,0.4);
  position: relative;
  z-index: 1;
}
#colophon span { color: var(--gold); }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; text-align: center; }
  .badge-row { justify-content: center; }
  .main-navigation { display: none; }
}

/* ─── WP ADMIN BAR FIX ─── */
.admin-bar #masthead { top: 32px; }
@media screen and (max-width: 782px) { .admin-bar #masthead { top: 46px; } }

/* ─── FLOATING NUMBERS BG (page bg animation) ─── */
.page-bg-nums {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
