/* ===========================
   Billy.family – style.css
   v5 – Vibrant Purple/Orange Theme
   =========================== */

:root {
  --bg: #0d0b1a;
  --bg2: #13102a;
  --bg3: #1a1638;
  --purple: #7c3aed;
  --purple2: #a855f7;
  --orange: #f97316;
  --orange2: #fb923c;
  --pink: #ec4899;
  --green: #22c55e;
  --wa-green: #25D366;
  --text: #f1f0ff;
  --text2: #9490c0;
  --border: #2d2860;
  --card: #16132e;
  --shadow: 0 4px 32px rgba(124,58,237,0.18);
  --radius: 16px;
  --glow: 0 0 40px rgba(124,58,237,0.25);
}

[data-theme="light"] {
  --bg: #f5f3ff;
  --bg2: #ede9fe;
  --bg3: #ddd6fe;
  --text: #1e1b4b;
  --text2: #5b5899;
  --border: #c4b5fd;
  --card: #fff;
  --shadow: 0 4px 24px rgba(124,58,237,0.15);
  --glow: 0 0 30px rgba(124,58,237,0.15);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ========== NAVBAR ========== */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,11,26,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .navbar { background: rgba(245,243,255,0.95); }
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px;
}
.logo {
  font-family: 'Boogaloo', cursive;
  font-size: 1.5rem;
  color: var(--text);
  text-decoration: none;
  display: flex; align-items: center; gap: 6px;
}
.logo-sn { color: var(--orange); }
.logo-emoji { font-size: 1.4rem; }
.logo-img { height: 44px; width: auto; display: block; }
.footer-logo-img { height: 38px; width: auto; display: block; opacity: 0.9; }
.nav-links { display: flex; gap: 20px; margin-left: auto; }
.nav-links a {
  color: var(--text2); text-decoration: none;
  font-weight: 600; font-size: 0.9rem;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--orange); }
.btn-admin {
  background: var(--purple); color: #fff !important;
  padding: 6px 14px; border-radius: 8px;
  font-weight: 700 !important;
}
.nav-actions { display: flex; gap: 8px; }
.icon-btn {
  background: var(--bg3); border: none; border-radius: 8px;
  cursor: pointer; font-size: 1.1rem; padding: 6px 10px;
  transition: background 0.2s;
}
.icon-btn:hover { background: var(--border); }
.nav-hamburger { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text); }
.mobile-menu {
  display: none; flex-direction: column;
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 12px 20px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a { color: var(--text); text-decoration: none; padding: 10px 0; font-weight: 600; border-bottom: 1px solid var(--border); }

@media (max-width: 700px) {
  .nav-links { display: none; }
  .nav-hamburger { display: block; }
}

/* ========== HERO ========== */
.hero {
  position: relative; min-height: 88vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.blob {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: 0.18;
}
.blob1 {
  width: 600px; height: 600px;
  background: var(--purple);
  top: -150px; left: -150px;
  animation: blobFloat 9s ease-in-out infinite;
}
.blob2 {
  width: 500px; height: 500px;
  background: var(--orange);
  bottom: -120px; right: -80px;
  animation: blobFloat 12s ease-in-out infinite reverse;
}
.blob3 {
  width: 350px; height: 350px;
  background: var(--pink);
  top: 40%; left: 60%;
  animation: blobFloat 7s ease-in-out infinite;
  opacity: 0.1;
}
@keyframes blobFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-40px) scale(1.08); }
}
.floating-emojis {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: space-around;
  font-size: 2.5rem; opacity: 0.07;
  pointer-events: none;
}
.floating-emojis span { animation: floatUp 6s ease-in-out infinite; }
.floating-emojis span:nth-child(2n) { animation-delay: -2s; }
.floating-emojis span:nth-child(3n) { animation-delay: -4s; }
.floating-emojis span:nth-child(4n) { animation-delay: -1s; }
@keyframes floatUp {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-25px) rotate(3deg); }
}
.hero-content {
  position: relative; z-index: 1;
  text-align: center; padding: 40px 20px;
  max-width: 720px; margin: 0 auto;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.4);
  color: var(--purple2); font-size: 0.85rem; font-weight: 700;
  padding: 6px 16px; border-radius: 20px; margin-bottom: 24px;
}
.hero-content h1 {
  font-family: 'Boogaloo', cursive;
  font-size: clamp(2.2rem, 7vw, 3.8rem);
  line-height: 1.15; margin-bottom: 16px;
}
.gradient-text {
  background: linear-gradient(135deg, var(--orange), var(--purple2), var(--pink));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub { color: var(--text2); font-size: 1.05rem; margin-bottom: 32px; line-height: 1.5; }

/* ========== GENERATOR CARD ========== */
.generator-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow), var(--glow);
  text-align: left;
}
.admin-msg {
  background: rgba(249,115,22,0.1); border-left: 4px solid var(--orange);
  color: var(--orange2); padding: 10px 14px;
  border-radius: 8px; margin-bottom: 16px;
  font-size: 0.9rem; font-weight: 600;
}
.admin-msg.hidden { display: none; }
.input-group {
  display: flex; align-items: center;
  background: var(--bg2); border: 2px solid var(--border);
  border-radius: 14px; padding: 10px 16px;
  gap: 10px; margin-bottom: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-group:focus-within { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(124,58,237,0.15); }
.input-icon { font-size: 1.2rem; }
.input-group input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 1.2rem; font-family: 'Boogaloo', cursive;
  letter-spacing: 3px;
}
.input-group input::placeholder { color: var(--text2); letter-spacing: 1px; }
.char-count { color: var(--text2); font-size: 0.8rem; white-space: nowrap; }
.input-hint {
  color: var(--purple2); font-size: 0.8rem; font-weight: 600;
  border-left: 3px solid var(--purple2);
  padding: 6px 10px; background: rgba(124,58,237,0.08);
  border-radius: 4px; margin-bottom: 16px;
}
.emoji-picker { margin-bottom: 16px; }
.mood-label { color: var(--text2); font-size: 0.85rem; font-weight: 700; display: block; margin-bottom: 8px; }
.emoji-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.emoji-btn {
  background: var(--bg3); border: 2px solid var(--border);
  border-radius: 10px; padding: 8px 12px;
  font-size: 1.3rem; cursor: pointer;
  transition: all 0.15s;
}
.emoji-btn:hover { border-color: var(--orange); transform: scale(1.15); }
.emoji-btn.active { border-color: var(--orange); background: rgba(249,115,22,0.15); box-shadow: 0 0 12px rgba(249,115,22,0.3); }
.btn-generate {
  width: 100%; padding: 16px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff; border: none; border-radius: 14px;
  font-size: 1.15rem; font-weight: 800;
  font-family: 'Boogaloo', cursive; letter-spacing: 1px;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 20px rgba(124,58,237,0.4);
}
.btn-generate:hover { transform: translateY(-3px); box-shadow: 0 8px 32px rgba(124,58,237,0.55); }
.btn-generate:active { transform: translateY(0); }
.btn-icon { font-size: 1.3rem; }

/* ========== RESULTS ========== */
.results-section { padding: 40px 20px; }
.results-section.hidden { display: none; }
.container { max-width: 900px; margin: 0 auto; }
.section-title {
  font-family: 'Boogaloo', cursive; font-size: 1.9rem;
  margin-bottom: 20px; text-align: center;
}

/* ── Viral share banner ── */
.viral-challenge-banner {
  background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(249,115,22,0.1));
  border: 1px solid rgba(124,58,237,0.35);
  border-radius: 14px; padding: 14px 20px;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap;
}
.viral-challenge-banner .vcb-text { flex: 1; }
.viral-challenge-banner .vcb-title { font-weight: 800; font-size: 1rem; color: var(--text); }
.viral-challenge-banner .vcb-sub { font-size: 0.82rem; color: var(--text2); margin-top: 2px; }
.btn-challenge {
  background: linear-gradient(135deg, var(--orange), var(--pink));
  color: #fff; border: none; border-radius: 10px;
  padding: 10px 18px; font-weight: 800; font-size: 0.9rem;
  cursor: pointer; white-space: nowrap;
  font-family: 'Nunito', sans-serif;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-challenge:hover { transform: scale(1.05); box-shadow: 0 4px 16px rgba(249,115,22,0.4); }

.result-preview { margin-bottom: 24px; text-align: center; }
.preview-grid {
  display: inline-flex; flex-direction: column; align-items: center; gap: 16px;
}
.emoji-grid {
  font-family: monospace; line-height: 1.1;
  font-size: clamp(8px, 2vw, 14px);
  background: var(--bg3); padding: 16px; border-radius: 12px;
  white-space: pre; display: block;
  border: 1px solid var(--border);
}
.emoji-canvas-preview {
  max-width: 220px; height: auto; border-radius: 12px;
  border: 2px solid var(--border);
}
.result-actions {
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
  margin-bottom: 16px;
}
.btn-action {
  padding: 10px 18px; border: 2px solid var(--border);
  background: var(--card); color: var(--text);
  border-radius: 10px; cursor: pointer; font-weight: 700;
  font-family: 'Nunito', sans-serif; transition: all 0.15s;
}
.btn-action:hover { border-color: var(--purple); color: var(--purple2); }
.btn-wa {
  background: linear-gradient(135deg, #25D366, #128C7E);
  border-color: #25D366; color: #fff !important;
}
.btn-wa:hover { box-shadow: 0 4px 16px rgba(37,211,102,0.4); transform: translateY(-1px); }
.wa-msg-box { text-align: left; }
.wa-msg-box label { display: block; color: var(--text2); font-size: 0.85rem; margin-bottom: 6px; }
.wa-msg-box textarea {
  width: 100%; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); padding: 10px; font-family: 'Nunito', sans-serif;
  resize: vertical; outline: none;
}
.wa-msg-box textarea:focus { border-color: var(--purple); }

/* ========== GALLERY ========== */
.gallery-section { padding: 60px 20px; }
.section-header { text-align: center; margin-bottom: 32px; }
.section-sub { color: var(--text2); font-size: 0.9rem; margin-top: 4px; }
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.gallery-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  cursor: pointer; transition: all 0.2s; overflow: hidden;
}
.gallery-item:hover { border-color: var(--purple); transform: translateY(-3px); box-shadow: var(--shadow); }
.gallery-grid-preview {
  font-family: monospace; font-size: 6px; line-height: 1.05;
  white-space: pre; display: block; overflow: hidden; max-height: 80px;
}
.gallery-meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px; font-size: 0.85rem;
}
.gallery-word { font-weight: 700; color: var(--orange); }
.gallery-wa {
  margin-left: auto; background: none; border: none; cursor: pointer;
  font-size: 1rem; padding: 4px;
}

/* ========== TRENDS ========== */
.trends-section { padding: 60px 20px; background: var(--bg2); }
.trends-grid { display: flex; flex-direction: column; gap: 10px; }
.trend-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; transition: all 0.15s;
}
.trend-item:hover { border-color: var(--orange); box-shadow: 0 2px 12px rgba(249,115,22,0.15); }
.trend-emoji { font-size: 1.5rem; }
.trend-word { font-weight: 800; font-family: 'Boogaloo', cursive; font-size: 1.15rem; }
.trend-count { color: var(--text2); font-size: 0.8rem; }
.trend-badge {
  margin-left: auto; background: rgba(249,115,22,0.15);
  color: var(--orange); border: 1px solid rgba(249,115,22,0.3);
  border-radius: 20px; padding: 2px 10px; font-size: 0.75rem; font-weight: 700;
}
.trend-wa {
  padding: 6px 14px;
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff; border: none; border-radius: 8px;
  font-size: 0.8rem; font-weight: 700; cursor: pointer;
  transition: transform 0.15s;
}
.trend-wa:hover { transform: scale(1.05); }

/* ========== PARTNERS ========== */
.partners-section { padding: 60px 20px; }
.partners-placeholder { text-align: center; color: var(--text2); }
.partners-placeholder a { color: var(--purple2); }

/* ========== AD BANNERS ========== */
.ad-banner { width: 100%; text-align: center; }
.ad-banner.hidden { display: none; }
.ad-top { background: var(--bg2); padding: 8px; border-bottom: 1px solid var(--border); }
.ad-inline { margin: 16px 0; }
.ad-footer { margin: 20px 0; }
.ad-sidebar { margin: 20px 0; }
.ad-text-banner {
  padding: 16px; background: var(--bg3);
  border: 1px dashed var(--border); border-radius: 8px;
  color: var(--text2); font-size: 0.9rem;
}

/* ========== POPUP ========== */
.popup-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.popup-overlay.hidden { display: none; }
.popup-content {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  max-width: 400px; width: 90%; position: relative;
}
.popup-close {
  position: absolute; top: 12px; right: 12px;
  background: var(--bg3); border: none; border-radius: 6px;
  cursor: pointer; font-size: 1rem; padding: 4px 8px; color: var(--text);
}

/* ========== UNITY OVERLAY ========== */
.unity-overlay {
  position: fixed; inset: 0; z-index: 1001;
  background: rgba(0,0,0,0.96);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
}
.unity-overlay.hidden { display: none; }
.unity-inner { width: 90%; max-width: 500px; text-align: center; }
.unity-progress-bar { width: 100%; height: 4px; background: #333; border-radius: 2px; margin: 16px 0; }
.unity-progress-fill { height: 100%; background: var(--orange); border-radius: 2px; width: 0%; transition: width 0.9s linear; }
.unity-controls { display: flex; align-items: center; justify-content: space-between; }
.unity-skip {
  padding: 8px 16px; background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; cursor: pointer; font-size: 0.9rem;
}
.unity-skip.hidden { display: none; }

/* ========== SPONSORED BAR ========== */
.sponsored-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 999;
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 10px 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.sponsored-bar.hidden { display: none; }
.sponsored-label { color: var(--text2); font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.sponsored-links { display: flex; gap: 12px; flex-wrap: wrap; flex: 1; }
.sponsored-link {
  color: var(--orange); text-decoration: none; font-size: 0.85rem;
  font-weight: 600; padding: 4px 8px;
  background: rgba(249,115,22,0.1); border-radius: 6px;
}
.sponsored-close { background: none; border: none; cursor: pointer; color: var(--text2); font-size: 1rem; }

/* ========== VIRAL CHALLENGE SECTION ========== */
.challenge-section {
  padding: 60px 20px;
  background: linear-gradient(135deg, rgba(124,58,237,0.08) 0%, rgba(249,115,22,0.06) 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.challenge-title {
  font-family: 'Boogaloo', cursive;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  margin-bottom: 10px;
}
.challenge-sub { color: var(--text2); font-size: 1rem; margin-bottom: 32px; }
.challenge-steps {
  display: flex; gap: 20px; justify-content: center;
  flex-wrap: wrap; margin-bottom: 32px;
}
.ch-step {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px 24px;
  min-width: 160px; flex: 1; max-width: 200px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.ch-step:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.ch-num {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff; border-radius: 50%;
  font-size: 1.2rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.ch-label { font-weight: 800; font-size: 1rem; margin-bottom: 4px; }
.ch-desc { color: var(--text2); font-size: 0.8rem; }
.btn-big-challenge {
  background: linear-gradient(135deg, var(--orange), var(--pink));
  color: #fff; border: none; border-radius: 16px;
  padding: 16px 40px; font-size: 1.2rem; font-weight: 800;
  font-family: 'Boogaloo', cursive; cursor: pointer;
  box-shadow: 0 6px 24px rgba(249,115,22,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  letter-spacing: 0.5px;
}
.btn-big-challenge:hover { transform: translateY(-3px); box-shadow: 0 10px 32px rgba(249,115,22,0.55); }

/* ========== FOOTER ========== */
.footer {
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 40px 20px; text-align: center;
}
.footer-inner { max-width: 900px; margin: 0 auto; }
.footer-logo { margin-bottom: 16px; }
.footer-logo-img { height: 38px; }
.footer-links {
  display: flex; gap: 20px; justify-content: center;
  margin-bottom: 16px; flex-wrap: wrap;
}
.footer-links a { color: var(--text2); text-decoration: none; font-size: 0.85rem; }
.footer-links a:hover { color: var(--orange); }
.footer-copy { color: var(--text2); font-size: 0.8rem; }

/* ========== TOAST ========== */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--card); border: 1px solid var(--purple);
  color: var(--text); padding: 12px 24px; border-radius: 12px;
  font-weight: 700; z-index: 9999; opacity: 0;
  transition: opacity 0.3s; white-space: nowrap;
  box-shadow: 0 4px 20px rgba(124,58,237,0.3);
}
.toast.show { opacity: 1; }
.toast.hidden { display: none; }

/* ========== PROMO MODELES SECTION ========== */
.promo-section {
  padding: 60px 0 40px;
  background: var(--bg2);
}
.promo-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px; margin-top: 32px;
}
.promo-cat {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 20px;
  transition: border-color 0.2s;
}
.promo-cat:hover { border-color: rgba(124,58,237,0.4); }
.promo-cat-title {
  font-size: 0.95rem; font-weight: 800;
  color: var(--orange2); margin-bottom: 14px;
  letter-spacing: 0.02em;
}
.promo-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.promo-chip {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 20px; padding: 6px 14px;
  font-size: 0.82rem; font-weight: 700;
  cursor: pointer; transition: all 0.15s;
  white-space: nowrap; color: var(--text); user-select: none;
}
.promo-chip:hover {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  border-color: transparent; color: #fff; transform: scale(1.06);
}
.promo-chip:active { transform: scale(0.97); }

/* ========== STATS COUNTER BAR ========== */
.stats-bar {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  padding: 20px;
  display: flex; gap: 0; justify-content: center; align-items: stretch;
  flex-wrap: wrap;
}
.stat-item {
  text-align: center; flex: 1; min-width: 140px; padding: 8px 20px;
  border-right: 1px solid rgba(255,255,255,0.2);
}
.stat-item:last-child { border-right: none; }
.stat-num {
  font-family: 'Boogaloo', cursive; font-size: 2rem; color: #fff;
  display: block; line-height: 1;
}
.stat-label { font-size: 0.75rem; color: rgba(255,255,255,0.75); font-weight: 600; margin-top: 2px; }

@media (max-width: 600px) {
  .promo-categories { grid-template-columns: 1fr; gap: 16px; }
  .promo-cat { padding: 16px; }
  .challenge-steps { gap: 12px; }
  .ch-step { min-width: 140px; padding: 16px; }
  .stats-bar { gap: 0; }
  .stat-item { min-width: 120px; padding: 8px 12px; }
  .stat-num { font-size: 1.5rem; }
}
