:root {
  /* Vibrant & Creative Palette */
  --bg: #030305;
  --bg2: #08080c;
  --bg3: #0c0d12;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.2);
  --text: #ffffff;
  --text-muted: #94a3b8;
  --text-dim: #475569;
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.4);
  
  --secondary: #d946ef; /* Magenta Accent */
  --accent: #22d3ee;    /* Cyan Accent */
  --gold: #fbbf24;      /* Gold Accent */
  
  --grad: linear-gradient(135deg, #6366f1 0%, #d946ef 100%);
  --grad-vibrant: linear-gradient(135deg, #22d3ee 0%, #6366f1 50%, #d946ef 100%);
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  /* Glassmorphism System */
  --glass-bg: rgba(8, 8, 12, 0.75);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-blur: 24px;
  
  /* Spacing & Auth */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;
  --container: 1200px;
  --transition: 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  --ease-spring: cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== ANIMATIONS ===== */
@keyframes reveal-up {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes reveal-scale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes float {
  0% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, 50px) rotate(2deg); }
  66% { transform: translate(-20px, 20px) rotate(-1deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes mesh-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}

.reveal { animation: reveal-up 0.8s var(--transition) both; }
.reveal-delay-1 { animation-delay: 0.1s; }
.reveal-delay-2 { animation-delay: 0.2s; }
.reveal-delay-3 { animation-delay: 0.3s; }

/* ===== LAYOUT ===== */
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--grad-vibrant);
  color: white;
  box-shadow: 0 4px 20px var(--primary-glow);
}
.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 30px var(--primary-glow);
}
.btn-primary:active { transform: translateY(0) scale(0.98); }

.btn-outline {
  background: rgba(255,255,255,0.03);
  border-color: var(--border);
  color: var(--text);
  backdrop-filter: blur(10px);
}
.btn-outline:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  background: var(--surface);
  color: #fff;
}

.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-icon { padding: 12px; border-radius: 14px; }

/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 30px 0;
  transition: all var(--transition);
}

.header.scrolled {
  padding: 18px 0;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
}

.nav { display: flex; align-items: center; justify-content: space-between; }

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.01em;
}
.logo-icon { width: 40px; height: 40px; filter: drop-shadow(0 0 8px var(--primary-glow)); }

/* ===== HERO ===== */
.hero {
  position: relative;
  padding: 200px 0 120px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  text-align: center;
  overflow: hidden;
}

.hero-content { position: relative; z-index: 10; }

.mesh-container {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--bg);
  pointer-events: none;
}

.mesh-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
  animation: float 25s infinite alternate ease-in-out;
}

.orb-primary { width: 600px; height: 600px; background: var(--primary); top: -200px; right: -100px; }
.orb-secondary { width: 500px; height: 500px; background: var(--secondary); bottom: -100px; left: -100px; animation-delay: -7s; }
.orb-accent { width: 400px; height: 400px; background: var(--accent); top: 20%; left: 30%; opacity: 0.15; animation-duration: 30s; }

.hero-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(circle at center, black 0%, transparent 90%);
  opacity: 0.5;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 32px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 15px var(--accent); }

.hero-title {
  font-size: clamp(3rem, 10vw, 5.5rem);
  margin-bottom: 24px;
  font-weight: 900;
  line-height: 1.05;
  background: linear-gradient(135deg, #fff 50%, rgba(255,255,255,0.4) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.04em;
}

.hero-desc {
  max-width: 650px;
  margin: 0 auto 48px;
  font-size: 1.25rem;
  color: var(--text-muted);
  font-weight: 400;
}

.hero-buttons { display: flex; gap: 20px; justify-content: center; }

/* ===== SECTION: CARDS ===== */
.section { padding: 120px 0; }
.section-header { text-align: center; margin-bottom: 80px; }
.section-title { font-size: 3rem; margin-bottom: 20px; font-weight: 800; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 40px;
}

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0) 100%);
  border: 1px solid var(--border);
  padding: 48px;
  border-radius: var(--radius-xl);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-12px) scale(1.02);
  border-color: var(--primary);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}

.card-icon {
  width: 64px;
  height: 64px;
  background: var(--surface);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
  color: var(--accent);
  transition: transform 0.5s var(--ease-spring);
}

.card:hover .card-icon { transform: rotate(10deg) scale(1.1); color: var(--secondary); }

.card h3 { margin-bottom: 16px; font-size: 1.4rem; font-weight: 700; }
.card p { color: var(--text-muted); font-size: 1rem; line-height: 1.6; }

/* ===== ROOM PAGE ===== */
.room-page { min-height: 100vh; display: flex; flex-direction: column; }

.room-header {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  backdrop-filter: blur(10px);
}

.room-main {
  flex: 1;
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 0;
}

.sidebar {
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.sidebar-card {
  padding: 24px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition);
}
.sidebar-card:hover { border-color: var(--primary); }

.sidebar-card h3 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); margin-bottom: 20px; font-weight: 800; }

.peer-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  background: var(--surface);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  transition: all var(--transition);
  border: 1px solid transparent;
}
.peer-item:hover { transform: translateX(8px); background: var(--surface-hover); border-color: var(--primary-glow); }

.peer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
}

/* CONTENT */
.room-content { flex: 1; padding: 60px; position: relative; overflow-y: auto; }

.drop-zone {
  background: linear-gradient(rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 2px dashed var(--border);
  border-radius: var(--radius-xl);
  padding: 100px 40px;
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
}

.drop-zone:hover, .drop-zone.dragging {
  border-color: var(--accent);
  background: rgba(34, 211, 238, 0.05); /* Accent tint */
  box-shadow: inset 0 0 40px rgba(34, 211, 238, 0.05);
}

.drop-zone-icon {
  width: 90px;
  height: 90px;
  background: var(--surface);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 32px;
  color: var(--accent);
  transition: transform 0.4s var(--ease-spring);
}
.drop-zone:hover .drop-zone-icon { transform: scale(1.1) rotate(-5deg); color: var(--gold); }

/* TRANSFERS */
.transfer-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  animation: reveal-scale 0.5s var(--transition) both;
}

.progress-wrap { height: 8px; background: rgba(255,255,255,0.05); border-radius: 100px; margin-top: 16px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--grad-vibrant); transition: width 0.3s ease; box-shadow: 0 0 15px var(--primary-glow); }

/* MODALS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 3, 5, 0.85);
  backdrop-filter: blur(var(--glass-blur));
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-box {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 48px;
  width: 100%;
  max-width: 500px;
  animation: reveal-up 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  box-shadow: 0 40px 100px rgba(0,0,0,0.8);
  position: relative;
}

.modal-tabs {
  display: flex;
  background: var(--bg);
  padding: 6px;
  border-radius: 14px;
  margin-bottom: 32px;
  border: 1px solid var(--border);
}

.modal-tab {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
  text-align: center;
}

.modal-tab.active {
  background: var(--surface);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.modal-tab-content { display: none; }
.modal-tab-content.active { display: block; }

/* ROOM HEADER SPECIFIC */
.room-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  width: 100%;
}

.room-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--surface);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 10px var(--warning);
}
.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
}

/* UTILS */
.hidden { display: none !important; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .room-main { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .section-title { font-size: 2.2rem; }
  .hero { padding: 150px 0 80px; }
  .modal-box { padding: 32px 24px; }
}

/* TOASTS */
#toastContainer { position: fixed; bottom: 32px; right: 32px; z-index: 9999; display: flex; flex-direction: column; gap: 12px; }
.toast {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  color: #fff;
  padding: 16px 24px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  animation: reveal-right 0.5s var(--transition) both;
}
@keyframes reveal-right {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}
.toast.out { opacity: 0; transform: translateX(50px); transition: 0.4s; }
