/* ============================================================
   ViaaMeetApp — main.css
   Global design system: variables, reset, utilities, shared
   ============================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --bg:          #0F172A;
  --bg-2:        #131E35;
  --bg-3:        #1A2744;
  --glass:       rgba(255, 255, 255, 0.06);
  --glass-hover: rgba(255, 255, 255, 0.10);
  --glass-border:rgba(255, 255, 255, 0.12);
  --primary:     #2563EB;
  --primary-light:#3B82F6;
  --primary-dark: #1D4ED8;
  --accent:      #38BDF8;
  --accent-2:    #0EA5E9;
  --success:     #22C55E;
  --danger:      #EF4444;
  --warning:     #F59E0B;
  --text:        #FFFFFF;
  --text-2:      rgba(255,255,255,0.7);
  --text-3:      rgba(255,255,255,0.4);
  --radius-sm:   8px;
  --radius:      14px;
  --radius-lg:   20px;
  --radius-xl:   28px;
  --shadow:      0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg:   0 20px 60px rgba(0,0,0,0.5);
  --trans:       all 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
  outline: none;
  cursor: pointer;
}
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ---------- Layout helpers ---------- */
.hidden { display: none !important; }
.w-full { width: 100%; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }

/* ---------- Animated Background ---------- */
.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: var(--bg);
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.25;
  animation: orbFloat 12s ease-in-out infinite;
  will-change: transform;
}
.orb-1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, #2563EB, transparent 70%);
  top: -200px; left: -200px;
  animation-delay: 0s;
}
.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #38BDF8, transparent 70%);
  bottom: -100px; right: -150px;
  animation-delay: -4s;
}
.orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #7C3AED, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -8s;
}
.grid-overlay {
  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: 60px 60px;
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.05); }
  66% { transform: translate(-30px, 40px) scale(0.95); }
}

/* ---------- Glassmorphism card ---------- */
.glass-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--trans);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.2s;
}
.btn:hover::after { background: rgba(255,255,255,0.06); }
.btn:active::after { background: rgba(255,255,255,0.12); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  box-shadow: 0 4px 24px rgba(37,99,235,0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(37,99,235,0.5);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text);
  backdrop-filter: blur(12px);
}
.btn-secondary:hover {
  background: var(--glass-hover);
  transform: translateY(-2px);
}

.btn-secondary-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 500;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: var(--trans);
}
.btn-secondary-sm:hover { background: var(--glass-hover); }

.btn-danger-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  color: #EF4444;
  border-radius: var(--radius-sm);
  transition: var(--trans);
  cursor: pointer;
}
.btn-danger-sm:hover { background: rgba(239,68,68,0.25); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  transition: var(--trans);
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--glass-hover);
  color: var(--text);
}
.icon-btn svg { flex-shrink: 0; }

/* ---------- Form elements ---------- */
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}
.form-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem 0.75rem 2.8rem;
  color: var(--text);
  font-size: 0.95rem;
  transition: var(--trans);
}
.form-input::placeholder { color: var(--text-3); }
.form-input:focus {
  border-color: var(--primary);
  background: rgba(37,99,235,0.08);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 0.85rem;
  color: var(--text-3);
  pointer-events: none;
  display: flex;
}
.toggle-pass {
  position: absolute;
  right: 0.75rem;
  color: var(--text-3);
  transition: var(--trans);
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
}
.toggle-pass:hover { color: var(--text); }

.form-group { margin-bottom: 1.1rem; }
.field-err {
  display: block;
  font-size: 0.78rem;
  color: var(--danger);
  margin-top: 0.3rem;
  min-height: 1em;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.checkbox-label input[type="checkbox"] { display: none; }
.checkmark {
  width: 18px; height: 18px;
  border: 2px solid var(--glass-border);
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
  transition: var(--trans);
}
.checkbox-label input:checked + .checkmark {
  background: var(--primary);
  border-color: var(--primary);
}
.checkbox-label input:checked + .checkmark::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 6px; height: 10px;
  border: 2px solid white;
  border-top: none; border-left: none;
  transform: rotate(45deg);
}

/* ---------- Toggle switch ---------- */
.toggle { position: relative; display: inline-flex; cursor: pointer; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  width: 44px; height: 24px;
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  position: relative;
  transition: background 0.25s;
  border: 1px solid var(--glass-border);
}
.toggle-track::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: white;
  top: 2px; left: 2px;
  transition: transform 0.25s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.toggle input:checked ~ .toggle-track {
  background: var(--primary);
  border-color: var(--primary);
}
.toggle input:checked ~ .toggle-track::after { transform: translateX(20px); }

/* ---------- Custom scrollbar ---------- */
.custom-scrollbar {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.custom-scrollbar::-webkit-scrollbar { width: 4px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.3);
}

/* ---------- Filter chips ---------- */
.filter-chips {
  display: flex;
  gap: 0.5rem;
  padding: 0 1.25rem 0.75rem;
  flex-wrap: wrap;
}
.chip {
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-2);
  transition: var(--trans);
  cursor: pointer;
}
.chip.active, .chip:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ---------- Avatar ---------- */
.avatar-initials {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-radius: inherit;
}

/* ---------- Shimmer loading ---------- */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.shimmer-list { display: flex; flex-direction: column; gap: 0.75rem; padding: 0 1rem; }
.shimmer-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--glass-border);
}
.shimmer-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.04) 100%);
  background-size: 400px 100%;
  animation: shimmer 1.5s infinite linear;
  flex-shrink: 0;
}
.shimmer-lines { flex: 1; display: flex; flex-direction: column; gap: 0.4rem; }
.shimmer-line {
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.04) 100%);
  background-size: 400px 100%;
  animation: shimmer 1.5s infinite linear;
}
.shimmer-line.w80 { width: 80%; }
.shimmer-line.w70 { width: 70%; }
.shimmer-line.w60 { width: 60%; }
.shimmer-line.w50 { width: 50%; }
.shimmer-line.w40 { width: 40%; }
.shimmer-line.w90 { width: 90%; }

/* ---------- Toast Notification ---------- */
.toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}
.toast {
  background: rgba(15,23,42,0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: toastIn 0.4s cubic-bezier(0.4,0,0.2,1);
}
.toast.removing { animation: toastOut 0.3s cubic-bezier(0.4,0,0.2,1) forwards; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100%); }
}
.toast-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.toast-icon.success { background: rgba(34,197,94,0.15); color: var(--success); }
.toast-icon.error   { background: rgba(239,68,68,0.15);  color: var(--danger);  }
.toast-icon.info    { background: rgba(56,189,248,0.15); color: var(--accent);  }
.toast-body { flex: 1; }
.toast-title { font-weight: 600; font-size: 0.88rem; margin-bottom: 0.1rem; }
.toast-msg   { font-size: 0.8rem; color: var(--text-2); }
.toast-close {
  color: var(--text-3); font-size: 1.2rem; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px; transition: var(--trans); flex-shrink: 0;
}
.toast-close:hover { color: var(--text); background: var(--glass-hover); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s;
}
.modal-card {
  background: rgba(15,23,42,0.95);
  backdrop-filter: blur(30px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn 0.3s cubic-bezier(0.4,0,0.2,1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--glass-border);
}
.modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.modal-search { padding: 1rem 1.25rem; }
.modal-search .form-input { padding-left: 1rem; }
.modal-list { max-height: 340px; overflow-y: auto; padding: 0 0.75rem 0.75rem; }
.modal-list .contact-item {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.75rem 1rem; border-radius: var(--radius);
  cursor: pointer; transition: var(--trans);
}
.modal-list .contact-item:hover { background: var(--glass); }
.modal-body { padding: 1.25rem; }

/* ---------- Status dot ---------- */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-3);
  margin-right: 4px;
  vertical-align: middle;
}
.status-dot.online  { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.busy    { background: var(--danger); }
.status-dot.away    { background: var(--warning); }

/* ---------- Misc animations ---------- */
@keyframes fadeIn { from {opacity:0;} to {opacity:1;} }
@keyframes slideUp { from {opacity:0; transform:translateY(20px);} to {opacity:1; transform:translateY(0);} }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.5;} }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .btn { padding: 0.65rem 1.2rem; font-size: 0.9rem; }
}
