/* ============================================
   PANDA GLOBAL V2 — Custom Design Tokens
   Matches tevo.app design system exactly
   ============================================ */

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

:root {
  --background: 0 0% 100%;
  --foreground: 224 71% 4%;
  --card: 0 0% 100%;
  --card-foreground: 224 71% 4%;
  --popover: 0 0% 100%;
  --popover-foreground: 224 71% 4%;
  --primary: 335 60% 59%;
  --primary-foreground: 0 0% 100%;
  --primary-glow: 335 65% 65%;
  --secondary: 220 14% 96%;
  --secondary-foreground: 220 9% 46%;
  --muted: 220 14% 96%;
  --muted-foreground: 220 9% 46%;
  --accent: 220 14% 96%;
  --accent-foreground: 224 71% 4%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;
  --border: 220 13% 91%;
  --input: 220 13% 91%;
  --ring: 335 60% 59%;
  --radius: 0.75rem;
}

.dark {
  --background: 224 47% 5%;
  --foreground: 210 40% 98%;
  --card: 224 47% 7%;
  --card-foreground: 210 40% 98%;
  --popover: 224 47% 7%;
  --popover-foreground: 210 40% 98%;
  --primary: 335 60% 59%;
  --primary-foreground: 0 0% 100%;
  --primary-glow: 335 65% 68%;
  --secondary: 215 28% 17%;
  --secondary-foreground: 210 40% 98%;
  --muted: 215 28% 12%;
  --muted-foreground: 217 10% 55%;
  --accent: 215 28% 17%;
  --accent-foreground: 210 40% 98%;
  --destructive: 0 63% 31%;
  --destructive-foreground: 210 40% 98%;
  --border: 215 28% 15%;
  --input: 215 28% 17%;
  --ring: 335 60% 59%;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

.font-display { font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif; }

/* --- Semantic background/text utilities --- */
.bg-background { background-color: hsl(var(--background)); }
.bg-muted { background-color: hsl(var(--muted)); }
.bg-card { background-color: hsl(var(--card)); }
.bg-foreground { background-color: hsl(var(--foreground)); }
.bg-primary { background-color: hsl(var(--primary)); }
.bg-primary\/10 { background-color: hsl(var(--primary) / 0.1); }
.bg-primary\/90 { background-color: hsl(var(--primary) / 0.9); }

.text-foreground { color: hsl(var(--foreground)); }
.text-background { color: hsl(var(--background)); }
.text-muted-foreground { color: hsl(var(--muted-foreground)); }
.text-primary { color: hsl(var(--primary)); }
.text-primary-foreground { color: hsl(var(--primary-foreground)); }
.text-primary-glow { color: hsl(var(--primary-glow)); }
.text-background\/70 { color: hsl(var(--background) / 0.7); }

.border-border { border-color: hsl(var(--border)); }
.border-background\/20 { border-color: hsl(var(--background) / 0.2); }
.border-primary\/15 { border-color: hsl(var(--primary) / 0.15); }
.border-primary\/10 { border-color: hsl(var(--primary) / 0.10); }

/* --- Typography --- */
.text-hero {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.text-section {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: hsl(var(--primary));
}

/* --- Header member badge --- */
.member-badge-panda {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding-left: 10px;
  border-left: 2px solid hsl(var(--primary) / 0.3);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition: all 0.3s ease;
  line-height: 1.3;
}
.member-badge-panda img {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 50%;
}
.member-badge-panda span {
  white-space: nowrap;
}
.member-badge-panda:hover {
  color: hsl(var(--primary));
  border-left-color: hsl(var(--primary));
}

/* --- Buttons --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 9999px;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-primary:hover {
  background-color: hsl(var(--primary) / 0.9);
  transform: translateY(-1px);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 9999px;
  background: transparent;
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-outline:hover {
  border-color: hsl(var(--foreground));
}

/* --- Surface Card --- */
.surface-card {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
}
.surface-card:hover {
  border-color: hsl(var(--foreground) / 0.15);
}

/* --- Form Fields --- */
.field {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  background-color: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  color: hsl(var(--foreground));
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.field:focus {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 2px hsl(var(--primary) / 0.15);
}

/* --- Animations --- */
@keyframes float {
  0%, 100% { transform: translate(-50%, -50%) translateY(0px); }
  50% { transform: translate(-50%, -50%) translateY(-12px); }
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fade-in 0.6s ease-out both;
}

/* --- Utility line clamp --- */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Star icon fill --- */
.fill-primary { fill: hsl(var(--primary)); }

/* --- Scrollbar styling --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: hsl(var(--background)); }
::-webkit-scrollbar-thumb { background: hsl(var(--border)); border-radius: 3px; }

/* --- Selection --- */
::selection {
  background: hsl(var(--primary) / 0.2);
  color: hsl(var(--foreground));
}

/* --- App icon placeholder gradient backgrounds --- */
.app-icon-gradient {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  border-radius: 1rem;
}

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  min-width: 320px;
  max-width: 420px;
  transform: translateX(120%);
  opacity: 0;
  animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.toast-out {
  animation: toastOut 0.3s ease-in forwards;
}

.toast-success { border-left: 4px solid #22c55e; }
.toast-error   { border-left: 4px solid #ef4444; }

.toast-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  margin-top: 0.1rem;
}

.toast-success .toast-icon { background: #dcfce7; color: #16a34a; }
.toast-error .toast-icon   { background: #fee2e2; color: #dc2626; }

.toast-body { flex: 1; }

.toast-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  margin-bottom: 0.15rem;
}

.toast-msg {
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.4;
}

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1.1rem;
  line-height: 1;
  transition: color 0.15s;
}

.toast-close:hover { color: hsl(var(--foreground)); }

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

@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(120%); opacity: 0; }
}
