/* ============================================================
   SINGO MINGO &#8212; Global Design System
   Phase 1 &#8212; Landing & Public Pages
   ============================================================ */

/* &#9472;&#9472; Google Fonts &#9472;&#9472; */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&family=DM+Sans:wght@400;500;600&display=swap&display=swap');

/* &#9472;&#9472; CSS Variables &#9472;&#9472; */
:root {
  /* Light Mode (default) */
  --bg:        #F5F3EF;
  --bg-alt:    #EDE9E3;
  --card:      #FFFFFF;
  --card-alt:  #F9F7F4;
  --primary:   #7C3AED;
  --primary-h: #6D28D9;
  --primary-s: #EDE9FD;
  --accent:    #0F766E;
  --accent-h:  #0D9488;
  --accent-s:  #CCFBF1;
  --text:      #111827;
  --text-sub:  #6B7280;
  --text-mute: #9CA3AF;
  --border:    #E5E0D8;
  --border-s:  #F0EDE8;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow:    0 8px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 48px rgba(0,0,0,0.12);
  --radius-sm: 10px;
  --radius:    18px;
  --radius-lg: 28px;
  --radius-xl: 40px;
  --nav-bg:    rgba(245,243,239,0.85);
  --overlay:   rgba(17,24,39,0.5);
}

[data-theme="dark"] {
  --bg:        #0F172A;
  --bg-alt:    #1E293B;
  --card:      #111827;
  --card-alt:  #1A2537;
  --primary:   #8B5CF6;
  --primary-h: #7C3AED;
  --primary-s: #1E1040;
  --accent:    #14B8A6;
  --accent-h:  #0D9488;
  --accent-s:  #042F2E;
  --text:      #F8FAFC;
  --text-sub:  #94A3B8;
  --text-mute: #64748B;
  --border:    #1E293B;
  --border-s:  #2D3748;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow:    0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 20px 48px rgba(0,0,0,0.5);
  --nav-bg:    rgba(15,23,42,0.9);
}

/* &#9472;&#9472; Reset & Base &#9472;&#9472; */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden; /* Prevent horizontal scroll globally */
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  transition: background 0.25s, color 0.25s;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* Prevent horizontal scroll on body */
  max-width: 100vw;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }

/* &#9472;&#9472; Typography &#9472;&#9472; */
h1, h2, h3, h4, h5 {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.1rem; }
p { color: var(--text-sub); }

/* &#9472;&#9472; Container &#9472;&#9472; */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .container { padding: 0 24px; } }
@media (min-width: 768px) { .container { padding: 0 40px; } }

/* &#9472;&#9472; Navbar &#9472;&#9472; */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 8px;
  min-width: 0; /* prevent flex overflow */
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.nav-logo .logo-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 10px;
  line-height: 0;
}
.nav-logo .logo-text {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.5px;
  color: var(--text);
  transition: color 0.3s;
  white-space: nowrap;
}
.nav-logo .logo-text span { color: var(--primary); }

/* Nav Links */
.nav-links {
  display: none;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}
@media (min-width: 900px) { .nav-links { display: flex; } }

.nav-links a {
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-sub);
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--primary);
  background: var(--primary-s);
}

/* Nav Right */
.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Hide desktop-only nav buttons on mobile */
.nav-btn-desktop { display: none; }
@media (min-width: 640px) { .nav-btn-desktop { display: inline-flex; } }

/* Theme Toggle */
.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
  color: var(--text-sub);
}
.theme-toggle:hover { background: var(--primary-s); color: var(--primary); border-color: var(--primary); }

/* Mobile Menu Btn */
.nav-hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
@media (min-width: 900px) { .nav-hamburger { display: none; } }
.nav-hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-sub);
  border-radius: 2px;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile Drawer */
.nav-mobile {
  display: none;
  flex-direction: column;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 16px 20px 24px;
  gap: 4px;
}
.nav-mobile.open { display: flex; }
@media (min-width: 900px) { .nav-mobile { display: none !important; } }
.nav-mobile a {
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 500;
  color: var(--text-sub);
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.nav-mobile a:hover, .nav-mobile a.active { color: var(--primary); background: var(--primary-s); }
.nav-mobile-divider { height: 1px; background: var(--border); margin: 8px 0; }
.nav-mobile .btn-primary { text-align: center; margin-top: 4px; }

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #fff !important;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  border: 2px solid transparent;
  white-space: nowrap;
}
.btn-primary:hover {
  background: var(--primary-h);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(124,58,237,0.35);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: var(--primary);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  font-family: 'DM Sans', sans-serif;
  border: 2px solid var(--primary);
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  white-space: nowrap;
}
.btn-outline:hover {
  background: var(--primary-s);
  transform: translateY(-1px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--card);
  color: var(--text);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.btn-ghost:hover { background: var(--bg-alt); }

.btn-lg { padding: 16px 36px; font-size: 1rem; border-radius: var(--radius); }
.btn-sm { padding: 8px 16px; font-size: 0.82rem; border-radius: 8px; }

/* Cards */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border-s);
  box-shadow: var(--shadow-sm);
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
}
.card:hover { box-shadow: var(--shadow);  }

/* Section Layout */
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.section-header { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.section-header h2 { margin-bottom: 16px; }
.section-header p { font-size: 1.05rem; }
.section-tag {
  display: inline-block;
  background: var(--primary-s);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 50px;
  margin-bottom: 16px;
  font-family: 'Sora', sans-serif;
}

/* Grid Helpers */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 20px; } }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge-success { background: #DCFCE7; color: #15803D; }
.badge-primary { background: var(--primary-s); color: var(--primary); }
.badge-accent { background: var(--accent-s); color: var(--accent); }
[data-theme="dark"] .badge-success { background: #14532D33; color: #4ADE80; }

/* Avatar */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* Divider */
.divider { height: 1px; background: var(--border); margin: 24px 0; }

/* Alert boxes */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.9rem;
}
.alert-info { background: var(--primary-s); border-left: 4px solid var(--primary); color: var(--text); }
.alert-success { background: #F0FDF4; border-left: 4px solid #22C55E; color: #15803D; }
.alert-warning { background: #FFFBEB; border-left: 4px solid #F59E0B; color: #92400E; }
[data-theme="dark"] .alert-success { background: #14532D22; color: #4ADE80; }
[data-theme="dark"] .alert-warning { background: #78350F22; color: #FCD34D; }

/* &#9472;&#9472; Footer &#9472;&#9472; */
.footer {
  background: #0F172A;
  color: #94A3B8;
  padding: 64px 0 32px;
  margin-top: auto;
}
[data-theme="dark"] .footer { background: #020817; border-top: 1px solid var(--border); }

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  margin-bottom: 48px;
}
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }

.footer-brand .footer-logo {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  color: #fff;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-brand .footer-logo .logo-dot { color: #8B5CF6; }
.footer-brand p { font-size: 0.9rem; line-height: 1.7; max-width: 280px; }
.footer-brand .social-links { display: flex; gap: 10px; margin-top: 24px; }
.footer-brand .social-links a {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: #1E293B;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
  color: #94A3B8;
}
.footer-brand .social-links a:hover { background: var(--primary); color: white; }

.footer-col h4 {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 12px; }
.footer-col a { font-size: 0.9rem; color: #94A3B8; transition: color 0.2s; }
.footer-col a:hover { color: #8B5CF6; }

.footer-bottom {
  border-top: 1px solid #1E293B;
  padding-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
@media (min-width: 640px) { .footer-bottom { flex-direction: row; justify-content: space-between; text-align: left; } }
.footer-bottom p { font-size: 0.85rem; }
.footer-bottom .footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom .footer-bottom-links a { font-size: 0.82rem; color: #64748B; }
.footer-bottom .footer-bottom-links a:hover { color: #94A3B8; }

/* &#9472;&#9472; Online Dot &#9472;&#9472; */
.online-dot {
  width: 10px; height: 10px;
  background: #22C55E;
  border-radius: 50%;
  border: 2px solid var(--card);
  flex-shrink: 0;
}

/* &#9472;&#9472; Utility &#9472;&#9472; */
.text-center { text-align: center; }
.text-primary { color: var(--primary) !important; }
.text-accent { color: var(--accent) !important; }
.text-sub { color: var(--text-sub) !important; }
.text-mute { color: var(--text-mute) !important; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.hidden { display: none !important; }

/* &#9472;&#9472; Page Hero (for inner pages) &#9472;&#9472; */
.page-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  padding: 64px 0 80px;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.page-hero .container { position: relative; }
.page-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  color: white;
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 20px;
  border: 1px solid rgba(255,255,255,0.25);
}
.page-hero h1 { color: white; margin-bottom: 16px; }
.page-hero p { color: rgba(255,255,255,0.8); font-size: 1.05rem; max-width: 560px; }

/* &#9472;&#9472; Floating shapes background decoration &#9472;&#9472; */
.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

/* &#9472;&#9472; Scroll animation &#9472;&#9472; */
.fade-in { opacity: 0; transition: opacity 0.35s ease; }
.fade-in.visible { opacity: 1; }

/* &#9472;&#9472; Custom Scrollbar &#9472;&#9472; */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-mute); }

/* &#9472;&#9472; Ad Placeholder (tasteful) &#9472;&#9472; */
.ad-unit {
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--text-mute);
  font-size: 0.8rem;
  min-height: 90px;
  padding: 16px;
}
.ad-unit-banner { min-height: 90px; }
.ad-unit-rect { min-height: 250px; }
.ad-unit span { font-size: 1.5rem; opacity: 0.4; }

/* -- Animated loading dots (global) -- */
.loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
}
.loading-dots span {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.3;
  animation: dotFade 1.2s ease-in-out infinite;
}
.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotFade {
  0%, 60%, 100% { opacity: 0.2; transform: translateY(0); }
  30%            { opacity: 1;   transform: translateY(-4px); }
}

/* -- Performance & Skeleton Loaders -- */
@keyframes shimmer {
  0%   { background-position: -300% 0; }
  100% { background-position:  300% 0; }
}
.skeleton {
  background: linear-gradient(90deg,
    var(--bg-alt) 25%,
    var(--border)  50%,
    var(--bg-alt) 75%);
  background-size: 300% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
  pointer-events: none;
}
.sk-avatar   { width:48px;  height:48px;  border-radius:50%; flex-shrink:0; }
.sk-line     { height:12px; border-radius:6px; }
.sk-line-sm  { height:10px; border-radius:5px; width:60%; }
.sk-line-xs  { height:9px;  border-radius:5px; width:40%; }
.sk-circle   { border-radius:50%; }
.sk-btn      { height:36px; border-radius:20px; width:72px; }

/* Skeleton chat row */
.sk-chat-row {
  display:flex; align-items:center; gap:12px;
  padding:13px 16px; border-bottom:1px solid var(--border-s);
}
.sk-chat-body { flex:1; display:flex; flex-direction:column; gap:7px; }

/* Skeleton stat card */
.sk-stat-card {
  background:var(--card); border:1px solid var(--border-s);
  border-radius:var(--radius-sm); padding:16px;
  display:flex; flex-direction:column; align-items:center; gap:8px;
}

/* GPU-accelerated touch targets */
.btn-primary, .btn-outline, .btn-ghost,
.sidebar-link, .mobile-nav-item, .chat-row {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Contain layout for cards */
.card, .stat-card, .dash-section { contain: layout style; }

/* Smooth scrolling only when user prefers it */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Bottom nav &#8211; GPU composite */
.mobile-bottom-nav { will-change: transform; }
