/* ===== THANKS — Shared CSS ===== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

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

:root {
  --bg: #050511;
  --bg2: #080820;
  --bg3: #0d0d2b;
  --glass: rgba(255,255,255,0.04);
  --glass-border: rgba(255,255,255,0.08);
  --glass-hover: rgba(255,255,255,0.07);
  --primary: #667eea;
  --secondary: #764ba2;
  --accent: #6366f1;
  --accent2: #a855f7;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 40px rgba(102,126,234,0.15);
  --transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(102,126,234,0.4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(102,126,234,0.7); }

/* ── Typography ── */
h1, h2, h3, h4, h5 { font-weight: 700; line-height: 1.2; }

.gradient-text {
  background: linear-gradient(135deg, #667eea 0%, #a855f7 50%, #764ba2 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite;
}

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

/* ── Glassmorphism Cards ── */
.glass-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  transition: var(--transition);
}

.glass-card:hover {
  background: var(--glass-hover);
  border-color: rgba(102,126,234,0.25);
  transform: translateY(-4px);
  box-shadow: var(--shadow), var(--shadow-glow);
}

.glass-card-static {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-primary:hover::before { opacity: 1; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(102,126,234,0.45); }
.btn-primary:active { transform: translateY(0); }
.btn-primary > * { position: relative; z-index: 1; }
.btn-primary span { position: relative; z-index: 1; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: var(--glass);
  border-color: rgba(102,126,234,0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102,126,234,0.15);
}

/* ── Navbar ── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 18px 0;
  transition: var(--transition);
}

.navbar.scrolled {
  background: rgba(5,5,17,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 12px 0;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text);
  background: var(--glass);
}

.nav-cta {
  padding: 8px 20px !important;
  background: linear-gradient(135deg, #667eea, #764ba2) !important;
  color: #fff !important;
  border-radius: 10px !important;
}

.nav-cta:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(102,126,234,0.35) !important;
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: var(--transition);
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

.nav-hamburger:hover { background: var(--glass); }

/* ── Hero ── */
.hero {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.hero-full { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.hero-small { min-height: 280px; display: flex; align-items: center; justify-content: center; padding-top: 80px; }

#vanta-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
  max-width: 800px;
}

/* ── Status Badge ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: 999px;
  font-size: 13px;
  color: var(--success);
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
  50% { opacity: 0.85; transform: scale(1.1); box-shadow: 0 0 0 6px rgba(34,197,94,0); }
}

.status-dot.warning { background: var(--warning); animation-name: pulse-dot-warning; }
@keyframes pulse-dot-warning {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(245,158,11,0); }
}

.status-dot.danger { background: var(--danger); animation: none; }

/* ── Section Layout ── */
.section {
  padding: 80px 0;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.section-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  margin-bottom: 16px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 560px;
}

/* ── Feature Cards ── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.feature-card {
  padding: 32px 28px;
  text-align: center;
}

.feature-icon-wrap {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: rgba(102,126,234,0.1);
  border: 1px solid rgba(102,126,234,0.2);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
}

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

/* ── Status Strip ── */
.status-strip {
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
  background: rgba(34,197,94,0.03);
  padding: 18px 0;
  text-align: center;
}

.status-strip-inner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
}

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--glass-border);
  padding: 40px 0 30px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
  list-style: none;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  transition: var(--transition);
}

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

/* ── Chat Bubbles ── */
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.chat-bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}

.chat-bubble.client {
  align-self: flex-start;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-bottom-left-radius: 4px;
}

.chat-bubble.admin {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(102,126,234,0.25), rgba(118,75,162,0.25));
  border: 1px solid rgba(102,126,234,0.3);
  border-bottom-right-radius: 4px;
}

.bubble-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
}

.bubble-time {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 4px;
  text-align: right;
}

/* ── Chat Input ── */
.chat-input-row {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--glass-border);
}

.chat-input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: var(--transition);
  resize: none;
}

.chat-input:focus {
  border-color: rgba(102,126,234,0.5);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.chat-input::placeholder { color: var(--text-dim); }

.chat-send-btn {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.chat-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(102,126,234,0.4);
}

.chat-send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Form Inputs ── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input, .form-select {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--text);
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: var(--transition);
  -webkit-appearance: none;
}

.form-input:focus, .form-select:focus {
  border-color: rgba(102,126,234,0.5);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.form-input::placeholder { color: var(--text-dim); }

.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.form-select option { background: var(--bg3); color: var(--text); }

.form-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
}

/* ── Admin Panel ── */
.admin-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
  padding-top: 0;
}

.admin-sidebar {
  width: 320px;
  flex-shrink: 0;
  border-right: 1px solid var(--glass-border);
  background: rgba(5,5,17,0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass);
}

.admin-convo-list {
  flex: 1;
  overflow-y: auto;
}

.convo-item {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.convo-item:hover { background: var(--glass); }
.convo-item.active { background: rgba(102,126,234,0.1); border-left: 3px solid var(--primary); }

.convo-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
}

.convo-info { flex: 1; min-width: 0; }
.convo-code { font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.convo-preview { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.convo-time { font-size: 11px; color: var(--text-dim); }

.unread-badge {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}

.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Lock Screen ── */
.lock-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lock-card {
  width: 100%;
  max-width: 400px;
  padding: 40px;
  text-align: center;
}

/* ── Skeleton / Loading ── */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 6px;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Spinner ── */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(102,126,234,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── Toast ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 14px 20px;
  background: var(--bg3);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  font-size: 14px;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 320px;
}

.toast.success { border-color: rgba(34,197,94,0.3); }
.toast.error { border-color: rgba(239,68,68,0.3); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  .nav-mobile-open .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(5,5,17,0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 16px;
    gap: 4px;
  }

  .nav-mobile-open .nav-links a { padding: 12px 16px; width: 100%; }

  .features-grid { grid-template-columns: 1fr; }

  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; height: 100%; border-right: none; }
  .admin-main { display: none; }
  .admin-main.mobile-active { display: flex; height: 100%; }
  .admin-sidebar.mobile-hidden { display: none; }

  .section { padding: 60px 20px; }
}

@media (max-width: 480px) {
  .chat-bubble { max-width: 90%; }
  .hero-content h1 { font-size: 36px; }
}

/* ── Gradient border utility ── */
.gradient-border {
  position: relative;
  background: var(--glass);
  border-radius: var(--radius);
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--radius) + 1px);
  background: linear-gradient(135deg, rgba(102,126,234,0.4), rgba(168,85,247,0.4), rgba(102,126,234,0.1));
  z-index: -1;
}

/* ── Tag/chip ── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(102,126,234,0.1);
  border: 1px solid rgba(102,126,234,0.2);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

/* ── Empty state ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 16px;
  color: var(--text-dim);
  padding: 40px;
  text-align: center;
}

.empty-state p { font-size: 14px; max-width: 260px; line-height: 1.5; }
