/* ============================================================
   STARFALL COLLECTIVE — SHARED DESIGN SYSTEM
   Modern Dark Tech / Sleek Cyberpunk / Glassmorphic UI
   ============================================================ */


:root {
  /* Color Palette */
  --bg-dark: #07090e;
  --bg-card: rgba(13, 17, 26, 0.75);
  --bg-card-hover: rgba(22, 29, 44, 0.85);
  --bg-card-active: rgba(30, 41, 59, 0.95);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-glass-strong: rgba(255, 255, 255, 0.06);

  --border-dim: rgba(255, 255, 255, 0.08);
  --border-bright: rgba(255, 255, 255, 0.18);
  --border-cyan: rgba(0, 240, 255, 0.35);
  --border-glow: rgba(0, 240, 255, 0.6);

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-dark: #334155;

  /* Accents */
  --cyan: #00f0ff;
  --cyan-glow: rgba(0, 240, 255, 0.25);
  --blue: #3b82f6;
  --purple: #8b5cf6;
  --pink: #ec4899;
  --green: #10b981;
  --green-glow: rgba(16, 185, 129, 0.25);
  --amber: #f59e0b;
  --red: #ef4444;

  /* Typography */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing & Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 24px rgba(0, 240, 255, 0.15);
  --shadow-glow-purple: 0 0 24px rgba(139, 92, 246, 0.2);

  /* Transitions */
  --trans-fast: 0.15s ease;
  --trans-base: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --trans-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  min-height: 100vh;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

/* Ambient Background Lights & Technical Grid */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at 50% 20%, #000 35%, transparent 75%);
}

.ambient-glow-1 {
  position: absolute;
  top: -150px;
  left: 20%;
  width: 600px;
  height: 500px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.08) 0%, transparent 70%);
  filter: blur(80px);
}

.ambient-glow-2 {
  position: absolute;
  top: 30%;
  right: 10%;
  width: 700px;
  height: 600px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.07) 0%, transparent 70%);
  filter: blur(90px);
}

.ambient-glow-3 {
  position: absolute;
  bottom: 0;
  left: 30%;
  width: 800px;
  height: 500px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.05) 0%, transparent 70%);
  filter: blur(100px);
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--text-main);
}

.mono {
  font-family: var(--font-mono);
}

/* Gradient Texts */
.text-gradient-cyan {
  background: linear-gradient(135deg, #ffffff 0%, var(--cyan) 60%, var(--purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-purple {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 50%, var(--pink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* High-tech Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--border-dim);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
}

.badge-online {
  color: var(--green);
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.08);
}

.badge-deployed {
  color: var(--cyan);
  border-color: rgba(0, 240, 255, 0.3);
  background: rgba(0, 240, 255, 0.08);
}

.badge-searching {
  color: var(--amber);
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.08);
}

.badge-offline {
  color: var(--text-dim);
  border-color: var(--border-dim);
  background: rgba(255, 255, 255, 0.02);
}

/* Live status "busy" (do not disturb) */
.badge-busy {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
}

.badge-offline .pulse-dot {
  animation: none;
  box-shadow: none;
  opacity: 0.5;
}

@media (prefers-reduced-motion: reduce) {
  .pulse-dot { animation: none; }
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: currentColor;
  box-shadow: 0 0 8px currentColor;
  display: inline-block;
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: transform var(--trans-base), border-color var(--trans-base), box-shadow var(--trans-base);
  position: relative;
  overflow: hidden;
}

.glass-card:hover {
  border-color: var(--border-bright);
  box-shadow: var(--shadow-lg);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--trans-base);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan) 0%, #0284c7 100%);
  color: #04101c;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #38bdf8 0%, #0369a1 100%);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.5);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: var(--border-dim);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-bright);
  color: #ffffff;
  transform: translateY(-2px);
}

.btn-outline-cyan {
  background: transparent;
  color: var(--cyan);
  border-color: var(--border-cyan);
}

.btn-outline-cyan:hover {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.25);
  transform: translateY(-2px);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: var(--red);
  color: #ffffff;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-bright);
  backdrop-filter: blur(16px);
  color: var(--text-main);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  min-width: 280px;
  max-width: 420px;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 0.2s, opacity 0.2s;
}

.toast.toast-success {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.toast.toast-error {
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #080b12;
}

::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #334155;
}


/* Site footer (hub, profile) */
.hub-footer {
  border-top: 1px solid var(--border-dim);
  background: rgba(7, 9, 14, 0.9);
  padding: 32px;
}

.hub-footer-inner {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

@media (max-width: 768px) {
  .hub-footer { padding: 24px 16px; }
  .hub-footer-inner { flex-direction: column; align-items: flex-start; }
}

/* The hidden attribute must win over component display rules (e.g. .btn) */
[hidden] { display: none !important; }
