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

:root {
  --bg-primary: #0a0a14;
  --bg-secondary: #0f0f1e;
  --glass-bg: rgba(255,255,255,0.035);
  --glass-bg-hover: rgba(255,255,255,0.055);
  --glass-border: rgba(255,255,255,0.08);
  --glass-border-hover: rgba(255,255,255,0.12);
  --glass-blur: blur(40px) saturate(180%);
  --glass-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.2);
  --glass-inset-highlight: inset 0 1px 0 rgba(255,255,255,0.06);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-pill: 100px;
  --text-primary: rgba(255,255,255,0.92);
  --text-secondary: rgba(255,255,255,0.55);
  --text-tertiary: rgba(255,255,255,0.35);
  --text-quaternary: rgba(255,255,255,0.2);
  --accent-blue: rgba(100,180,255,0.85);
  --accent-green: rgba(52,199,89,0.85);
  --accent-orange: rgba(255,159,10,0.85);
  --accent-red: rgba(255,69,58,0.85);
  --accent-purple: rgba(175,130,255,0.85);
  --accent-gold: rgba(255,214,10,0.85);
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --ease-out-expo: cubic-bezier(0.16,1,0.3,1);
  --ease-spring: cubic-bezier(0.34,1.56,0.64,1);
  --nav-height: 64px;
}

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

html {
  scroll-behavior: smooth;
}

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

#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}

.bg-blob-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(64,150,255,0.6) 0%, transparent 70%);
  top: -200px;
  left: -200px;
  animation: blobDrift1 20s ease-in-out infinite;
}

.bg-blob-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(150,80,255,0.6) 0%, transparent 70%);
  top: 30%;
  right: -150px;
  animation: blobDrift2 25s ease-in-out infinite;
}

.bg-blob-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(52,199,89,0.5) 0%, transparent 70%);
  bottom: 10%;
  left: 20%;
  animation: blobDrift3 18s ease-in-out infinite;
}

.bg-blob-4 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(255,159,10,0.4) 0%, transparent 70%);
  bottom: -100px;
  right: 30%;
  animation: blobDrift4 22s ease-in-out infinite;
}

#app {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - var(--nav-height));
  padding-top: var(--nav-height);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }

p { line-height: 1.6; color: var(--text-secondary); }

a { text-decoration: none; color: inherit; }

img, video { max-width: 100%; display: block; }

button { cursor: pointer; font-family: var(--font-family); border: none; background: none; }

/* Glass Card */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-shadow), var(--glass-inset-highlight);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.glass-card:hover {
  border-color: var(--glass-border-hover);
  background: var(--glass-bg-hover);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: var(--font-family);
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all 0.25s var(--ease-out-expo);
  will-change: transform;
  white-space: nowrap;
  border: none;
  outline: none;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255,255,255,0);
  transition: background 0.2s ease;
}

.btn:hover::after { background: rgba(255,255,255,0.06); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, rgba(64,150,255,0.9) 0%, rgba(100,80,255,0.9) 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(64,150,255,0.3), inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(64,150,255,0.45), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-secondary {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  box-shadow: var(--glass-shadow);
}

.btn-secondary:hover {
  border-color: var(--glass-border-hover);
  transform: translateY(-1px);
  background: var(--glass-bg-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--glass-border);
  background: var(--glass-bg);
}

.btn-danger {
  background: linear-gradient(135deg, rgba(255,69,58,0.85) 0%, rgba(200,40,30,0.85) 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(255,69,58,0.3);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(255,69,58,0.45);
}

.btn-sm { padding: 8px 18px; font-size: 0.875rem; }
.btn-lg { padding: 16px 36px; font-size: 1rem; }
.btn-xl { padding: 18px 44px; font-size: 1.0625rem; }

.btn-full { width: 100%; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-loading {
  pointer-events: none;
}

.btn-loading .btn-text { opacity: 0; }

.btn-spinner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.btn-loading .btn-spinner { display: block; }

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

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text-secondary);
}

.badge-blue {
  background: rgba(64,150,255,0.12);
  border-color: rgba(64,150,255,0.25);
  color: var(--accent-blue);
}

.badge-green {
  background: rgba(52,199,89,0.12);
  border-color: rgba(52,199,89,0.25);
  color: var(--accent-green);
}

.badge-purple {
  background: rgba(150,80,255,0.12);
  border-color: rgba(150,80,255,0.25);
  color: var(--accent-purple);
}

.badge-gold {
  background: rgba(255,214,10,0.12);
  border-color: rgba(255,214,10,0.25);
  color: var(--accent-gold);
}

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

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-sm {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Section */
.section {
  padding: 96px 0;
}

.section-sm { padding: 64px 0; }
.section-lg { padding: 128px 0; }

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

/* Flex helpers */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }

/* Text helpers */
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }

/* Navbar */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  background: rgba(10,10,20,0.7);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  transition: background 0.3s ease;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  gap: 16px;
  position: relative;
}

.nav-logo {
  flex-shrink: 0;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  flex-shrink: 0;
  display: block;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-uniq {
  opacity: 0.65;
  font-weight: 600;
}

.nav-links {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--glass-bg);
}

.nav-link.active {
  color: var(--text-primary);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}

.nav-actions { flex-shrink: 0; }

.nav-guest {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-user { position: relative; }

.avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(64,150,255,0.8) 0%, rgba(100,80,255,0.8) 100%);
  border: 1px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.avatar-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(64,150,255,0.4);
}

.avatar-initials {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
}

.avatar-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  background: rgba(15,15,30,0.95);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  overflow: hidden;
  transform-origin: top right;
  animation: dropdownOpen 0.2s var(--ease-out-expo) forwards;
  z-index: 200;
}

.dropdown-header {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.dropdown-email {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.dropdown-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 4px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  text-align: left;
  text-decoration: none;
  background: none;
  border: none;
  font-family: var(--font-family);
}

.dropdown-item:hover {
  background: var(--glass-bg);
  color: var(--text-primary);
}

.dropdown-item-danger { color: var(--accent-red); }
.dropdown-item-danger:hover { background: rgba(255,69,58,0.1); color: var(--accent-red); }

.nav-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
  background: none;
  border: none;
}

.nav-mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Toast container */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

/* Modal container */
#modal-container {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#modal-container.active {
  pointer-events: all;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-box {
  position: relative;
  z-index: 1;
  max-width: 500px;
  width: 90%;
  background: rgba(15,15,30,0.95);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: 0 40px 80px rgba(0,0,0,0.5);
  padding: 32px;
  animation: modalOpen 0.35s var(--ease-spring) forwards;
}

/* Input styles */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.input-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.input-wrapper {
  position: relative;
}

.input-field {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-family: var(--font-family);
  color: var(--text-primary);
  outline: none;
  transition: all 0.25s ease;
  -webkit-appearance: none;
}

.input-field::placeholder { color: var(--text-quaternary); }

.input-field:focus {
  border-color: rgba(64,150,255,0.5);
  background: rgba(64,150,255,0.06);
  box-shadow: 0 0 0 3px rgba(64,150,255,0.1);
}

.input-field.error {
  border-color: rgba(255,69,58,0.6);
  background: rgba(255,69,58,0.06);
}

.input-error-msg {
  font-size: 0.8rem;
  color: var(--accent-red);
  min-height: 16px;
}

/* Select */
select.input-field {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

select.input-field option {
  background: #1a1a2e;
  color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* Icon helpers */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon svg { width: 100%; height: 100%; }
.icon--xs  { width: 14px; height: 14px; }
.icon--sm  { width: 18px; height: 18px; }
.icon--md  { width: 20px; height: 20px; }
.icon--lg  { width: 24px; height: 24px; }
.icon--xl  { width: 32px; height: 32px; }
.icon--2xl { width: 48px; height: 48px; }

/* Section label */
.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* Language switcher */
.nav-lang-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

.lang-btn {
  width: 32px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: transparent;
  border: none;
  transition: background 0.15s ease;
  padding: 0;
  overflow: hidden;
}

.lang-btn:hover {
  background: rgba(255,255,255,0.06);
}

.lang-btn.active {
  background: rgba(255,255,255,0.1);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent-primary, #4096ff);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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