/* SkillSwap — Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ───── TOKENS ───── */
:root {
  --bg:          #F7F7F5;
  --card:        #FFFFFF;
  --primary:     #6C7A89;
  --primary-dk:  #57636f;
  --secondary:   #A8B5A2;
  --secondary-lt:#E8EFE6;
  --accent:      #6C7A89;
  --text:        #1F1F1F;
  --text-muted:  #6B6B6B;
  --text-light:  #9BA5AD;
  --border:      #E8E8E6;
  --danger:      #D97059;
  --success:     #6aab7a;
  --shadow-sm:   0 1px 4px rgba(0,0,0,0.06);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.10);
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;
  --transition:  0.22s ease;
  --nav-h:       68px;
}

/* ───── RESET ───── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
input, textarea, button, select { font-family: inherit; font-size: 1rem; }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

/* ───── LAYOUT ───── */
.app-wrapper {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg);
}

.screen {
  display: none;
  min-height: calc(100vh - 62px);
  padding: 24px 20px calc(62px + 28px);
  animation: fadeIn 0.2s ease;
}
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Full screen sections have no nav */
#screen-onboarding, #screen-login {
  min-height: 100vh;
  padding: 40px 24px 48px;
  display: none;
}
#screen-onboarding.active, #screen-login.active { display: block; }

/* ───── NAV BAR ───── */
.nav-bar {
  position: fixed;
  bottom: 12px; left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  height: 62px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(234,234,234,0.8);
  border-radius: 20px;
  display: none;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.06);
  padding: 0 4px;
}
.nav-bar.visible { display: flex; }

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 7px 10px;
  border-radius: 14px;
  transition: color 0.2s ease, background 0.2s ease, transform 0.18s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
  flex: 1;
  color: var(--text-light);
  border: none;
  background: transparent;
  outline: none;
}
.nav-item:hover { color: var(--primary); transform: scale(1.05); }
.nav-item:active { transform: scale(0.92); }
.nav-item.active {
  color: var(--primary);
  background: rgba(108,122,137,0.10);
  transform: scale(1.05);
}
.nav-item svg { width: 21px; height: 21px; stroke-width: 1.9; transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1); }
.nav-item.active svg { transform: scale(1.08); }
.nav-label { font-size: 10px; font-weight: 600; letter-spacing: 0.02em; }
.nav-badge {
  position: absolute;
  top: 5px; right: 12px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  width: 16px; height: 16px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: var(--transition);
  box-shadow: 0 2px 6px rgba(217,112,89,0.35);
}
.nav-badge.show { opacity: 1; }

/* ───── PAGE HEADER ───── */
.page-header {
  margin-bottom: 28px;
}
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ───── CARDS ───── */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid #EAEAEA;
  padding: 20px;
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* User card */
.user-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 0 0 1px #EAEAEA;
  border: 1px solid #EAEAEA;
  padding: 22px 20px;
  margin-bottom: 16px;
  transition: box-shadow 0.22s ease, transform 0.22s ease;
}
.user-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.09), 0 0 0 1px #d8d8d8; transform: translateY(-3px); }

.user-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.avatar {
  width: 48px; height: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--secondary-lt) 0%, #d4ddd2 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
  border: 2px solid var(--border);
}
.avatar-lg {
  width: 72px; height: 72px;
  font-size: 1.6rem;
}
.user-name { font-size: 1rem; font-weight: 600; color: var(--text); }
.match-score {
  margin-left: auto;
  background: linear-gradient(135deg, #fff8e8 0%, #fef0cc 100%);
  color: #8a6a10;
  font-size: 0.73rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid #f0dfa0;
  box-shadow: 0 1px 4px rgba(180,140,20,0.12);
}

/* Context line under name */
.card-context {
  font-size: 0.78rem;
  color: var(--secondary);
  font-weight: 500;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Skill section within card */
.skill-section { margin-bottom: 10px; }
.skill-section:last-child { margin-bottom: 0; }
.skill-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 6px;
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: var(--transition);
}
.tag-teach {
  background: var(--secondary-lt);
  color: #4a6949;
  border: 1px solid #c5d8c2;
}
.tag-learn {
  background: #eef0f5;
  color: var(--primary);
  border: 1px solid #d4d9e0;
}
.tag-match {
  background: #fff8e6;
  color: #a07a2a;
  border: 1px solid #e8d9aa;
}
.tag-neutral {
  background: #f2f2f1;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.tag-remove {
  background: none; border: none;
  color: inherit; padding: 0;
  cursor: pointer;
  display: flex; align-items: center;
  opacity: 0.6;
  transition: var(--transition);
}
.tag-remove:hover { opacity: 1; }

/* ───── CARD ACTIONS ───── */
.card-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ───── BUTTONS ───── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  flex: 1;
}
.btn-primary:hover { background: var(--primary-dk); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); background: #f0f2f5; }

.btn-secondary {
  background: #f0f2f4;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  flex: 1;
}
.btn-secondary:hover { background: #e4e8ec; color: var(--primary); border-color: var(--primary); }

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover { background: #5a9668; }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid #f0c8be;
}
.btn-danger:hover { background: #fdf1ee; }

.btn-full { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 24px; font-size: 1rem; }

/* ───── FORMS ───── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}
.form-label span { color: var(--danger); margin-left: 2px; }

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input::placeholder { color: var(--text-light); }
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,122,137,0.12);
}
.form-input.error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(217,112,89,0.10); }

textarea.form-input { resize: vertical; min-height: 100px; line-height: 1.5; }

.form-error {
  font-size: 0.78rem;
  color: var(--danger);
  margin-top: 5px;
  display: none;
}
.form-error.show { display: block; }

/* Skill input row */
.skill-input-row {
  display: flex;
  gap: 8px;
}
.skill-input-row .form-input { flex: 1; }

.skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  min-height: 0;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 5px 10px 5px 12px;
  border-radius: var(--radius-full);
  border: 1.5px solid;
  animation: chipIn 0.15s ease;
}
@keyframes chipIn { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }
.chip-teach { background: var(--secondary-lt); color: #4a6949; border-color: #c5d8c2; }
.chip-learn { background: #eef0f5; color: var(--primary); border-color: #d4d9e0; }
.chip-btn {
  background: none; border: none; padding: 0;
  cursor: pointer;
  color: inherit;
  opacity: 0.55;
  display: flex; align-items: center;
  transition: var(--transition);
}
.chip-btn:hover { opacity: 1; }

/* Contact section */
.contact-section {
  background: #f5f5f3;
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 20px;
}
.contact-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.contact-helper {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: -10px;
  margin-bottom: 14px;
}

/* ───── SEARCH ───── */
.search-wrapper {
  position: relative;
  margin-bottom: 20px;
}
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  width: 18px; height: 18px;
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-input::placeholder { color: var(--text-light); }
.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,122,137,0.10);
}

/* ───── MODAL ───── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,24,28,0.5);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 28px 24px 44px;
  width: 100%;
  max-width: 480px;
  transform: translateY(40px) scale(0.98);
  transition: transform 0.28s cubic-bezier(0.32,0.72,0,1), opacity 0.25s ease;
  max-height: 85vh;
  overflow-y: auto;
  opacity: 0;
  box-shadow: 0 -4px 32px rgba(0,0,0,0.12);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); opacity: 1; }
.modal-handle {
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: var(--radius-full);
  margin: 0 auto 20px;
}
.modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.modal-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 20px; }

/* ───── SECTION DIVIDER ───── */
.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 18px;
  color: var(--text-light);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.section-divider::before, .section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ───── REQUEST CARD ───── */
.request-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 18px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.request-card:hover { box-shadow: var(--shadow-md); }

.request-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.request-name { font-weight: 600; font-size: 0.95rem; }
.request-time { font-size: 0.75rem; color: var(--text-light); margin-left: auto; }
.request-message {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  background: #f7f7f5;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 14px;
  border-left: 3px solid var(--border);
  font-style: italic;
}
.request-actions { display: flex; gap: 8px; }

/* ───── CONNECTION CARD ───── */
.connection-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.contact-detail {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: #f7f7f5;
  border-radius: var(--radius-md);
  margin-top: 8px;
}
.contact-detail svg { width: 16px; height: 16px; color: var(--primary); flex-shrink: 0; }
.contact-detail-label { font-size: 0.75rem; color: var(--text-light); }
.contact-detail-value { font-size: 0.875rem; font-weight: 500; color: var(--text); }

/* ───── PROFILE SCREEN ───── */
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 0 24px;
  margin-bottom: 20px;
}
.profile-name {
  font-size: 1.4rem;
  font-weight: 700;
  margin-top: 14px;
  margin-bottom: 4px;
}
.profile-joined { font-size: 0.8rem; color: var(--text-light); }

.profile-section {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.profile-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 12px;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--danger);
  padding: 12px 0;
  cursor: pointer;
  background: none;
  border: none;
  transition: var(--transition);
}
.logout-btn:hover { opacity: 0.75; }

/* ───── EMPTY STATE ───── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}
.empty-icon {
  font-size: 2.8rem;
  margin-bottom: 18px;
  opacity: 0.5;
}
.empty-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.empty-desc { font-size: 0.85rem; color: var(--text-light); line-height: 1.5; margin-bottom: 20px; }
.empty-cta { margin-top: 4px; }

/* ───── PREFERRED CONTACT BADGE ───── */
.preferred-contact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--primary);
  background: rgba(108,122,137,0.09);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-top: 6px;
  border: 1px solid rgba(108,122,137,0.15);
}

/* ───── SCREEN TRANSITION ───── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.screen.active { animation: slideUp 0.22s ease; }

/* ───── ONBOARDING SPECIFIC ───── */
.onboard-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}
.onboard-logo-icon {
  width: 40px; height: 40px;
  background: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.onboard-logo-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.onboard-headline {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin-bottom: 8px;
}
.onboard-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.5;
}

/* ───── TOAST ───── */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 999;
  box-shadow: var(--shadow-lg);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ───── SCROLLBAR ───── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ───── UTILITIES ───── */
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.mt-auto { margin-top: auto; }
.text-muted { color: var(--text-muted); font-size: 0.875rem; }
.font-semibold { font-weight: 600; }

/* Pending sent badge */
.sent-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-light);
  background: #f2f2f1;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  letter-spacing: 0.04em;
}

/* "You" indicator on profile view */
.you-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--secondary);
  background: var(--secondary-lt);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  margin-left: 8px;
  vertical-align: middle;
}
