/* ========================================
   KRAFT — Page-specific styles
   ======================================== */

/* ---- Onboarding ---- */
.onboarding-hero {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  padding: 48px 24px 32px;
  position: relative;
  overflow: hidden;
}

.onboarding-hero::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(244,176,0,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.onboarding-hero::after {
  content: '';
  position: absolute;
  bottom: 40px;
  left: -80px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(15,118,110,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.hero-logo-mark {
  width: 48px;
  height: 48px;
  background: var(--yellow);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  color: var(--navy);
  letter-spacing: -1px;
  flex-shrink: 0;
}

.hero-logo-name {
  font-size: 28px;
  font-weight: 900;
  color: var(--white);
  letter-spacing: -0.5px;
}

.hero-logo-tagline {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
}

.hero-headline {
  font-size: 32px;
  font-weight: 900;
  color: var(--white);
  line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 24px;
}

.hero-headline span { color: var(--yellow); }

.hero-values {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 40px;
}

.hero-value-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.hero-value-icon {
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.hero-value-text h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 2px;
}

.hero-value-text p {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  line-height: 1.4;
}

.hero-quote {
  margin-bottom: 32px;
  padding: 16px;
  border-left: 3px solid var(--yellow);
  background: rgba(255,255,255,0.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.hero-quote p {
  font-size: 15px;
  font-style: italic;
  color: rgba(255,255,255,0.75);
  line-height: 1.5;
}

.hero-cta { position: relative; z-index: 1; }

/* ---- Onboarding form ---- */
.onboarding-form {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--off-white);
  display: none;
  flex-direction: column;
}

.onboarding-form.active { display: flex; }

.form-header {
  background: var(--white);
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--gray-150);
  position: sticky;
  top: 0;
  z-index: 10;
}

.form-progress {
  height: 3px;
  background: var(--gray-150);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 12px;
}

.form-progress-bar {
  height: 100%;
  background: var(--yellow);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.form-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.onboarding-step { display: none; }
.onboarding-step.active { display: block; }

.step-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.step-subtitle {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 24px;
}

.form-footer {
  padding: 16px 20px;
  background: var(--white);
  border-top: 1px solid var(--gray-150);
  position: sticky;
  bottom: 0;
}

/* ---- Home page ---- */
.home-greeting {
  padding: 20px 16px 0;
}

.home-greeting-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 4px;
}

.greeting-label {
  font-size: 14px;
  color: var(--gray-500);
  font-weight: 500;
  margin-bottom: 2px;
}

.greeting-title {
  font-size: 26px;
  font-weight: 900;
  color: var(--navy);
  letter-spacing: -0.8px;
  line-height: 1.1;
}

/* ---- Matching page ---- */
.matching-header {
  padding: 16px 16px 0;
}

.matching-count {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 16px;
}

.match-cards-stack {
  padding: 0 16px;
  position: relative;
}

.match-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 16px;
}

.match-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--gray-300);
  transition: var(--transition);
}

.match-dot.active {
  background: var(--navy);
  width: 20px;
}

/* ---- Map page (Leaflet) ---- */
.map-page-wrap {
  position: relative;
  width: 100%;
  height: calc(100dvh - var(--header-h) - var(--nav-h));
  overflow: hidden;
}

#kraft-map {
  width: 100%;
  height: 100%;
}

.map-topbar {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 600;
  /* needed so dropdown positions relative to this */
}

.map-city-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 8px 14px;
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius-full);
  box-shadow: 0 2px 12px rgba(11,19,32,0.25);
  cursor: pointer;
}

.map-city-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 220px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(11,19,32,0.22);
  overflow: hidden;
  z-index: 700;
}

.map-city-dropdown.open { display: block; }

.map-city-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-100);
}

.map-city-search {
  border: none;
  outline: none;
  font-size: 13px;
  font-family: var(--font);
  color: var(--navy);
  background: transparent;
  width: 100%;
}

.map-city-search::placeholder { color: var(--gray-400); }

.map-city-list {
  max-height: 220px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.map-city-option {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  transition: background 0.1s;
}

.map-city-option:hover,
.map-city-option:active { background: var(--off-white); }

.map-filters {
  position: absolute;
  top: 62px;
  left: 0;
  right: 0;
  z-index: 500;
  padding: 0 12px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.map-filters::-webkit-scrollbar { display: none; }

.map-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  background: var(--white);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-700);
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 12px rgba(11,19,32,0.14);
  border: 1.5px solid transparent;
  flex-shrink: 0;
  user-select: none;
}

.map-filter-pill:active { transform: scale(0.96); }

.map-filter-pill.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

/* Leaflet custom markers */
.lf-pin {
  width: 40px;
  height: 40px;
  border-radius: 50% 50% 50% 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 3px 10px rgba(11,19,32,0.25);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.lf-pin:active { transform: scale(0.92); }

.lf-pin-event {
  border-radius: 50% 50% 50% 4px;
}

.lf-pin-user {
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  width: 38px;
  height: 38px;
}

.lf-pin-me {
  width: 16px;
  height: 16px;
  background: #4285F4;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(66,133,244,0.5), 0 0 0 8px rgba(66,133,244,0.15);
}

/* Override Leaflet defaults */
.leaflet-control-zoom a {
  font-family: var(--font) !important;
  font-weight: 700 !important;
  color: var(--navy) !important;
  border-radius: var(--radius-sm) !important;
}

.leaflet-control-zoom {
  border: none !important;
  box-shadow: var(--shadow-md) !important;
}

.map-pin-detail {
  position: absolute;
  bottom: 16px;
  left: 12px;
  right: 12px;
  z-index: 600;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 18px 16px 16px;
  box-shadow: var(--shadow-xl);
  display: none;
}

.map-pin-detail.visible { display: block; animation: slideUp 0.25s cubic-bezier(0.4,0,0.2,1); }

.map-pin-detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  color: var(--gray-600);
  transition: var(--transition);
}

.map-pin-detail-close:hover { background: var(--gray-200); }

/* ---- Create event page ---- */
.create-header {
  background: var(--white);
  padding: 16px 16px 0;
  border-bottom: 1px solid var(--gray-100);
}

.create-form-body {
  padding: 20px 16px;
}

/* ---- Event detail ---- */
.event-detail-cover {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--navy) 0%, #1A2840 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  position: relative;
}

.event-detail-body {
  padding: 0 16px;
}

.event-detail-title {
  font-size: 24px;
  font-weight: 900;
  color: var(--navy);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.event-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
  color: var(--gray-600);
}

.event-info-row:last-child { border-bottom: none; }

.event-info-icon {
  width: 32px;
  height: 32px;
  background: var(--off-white);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}

.participants-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
}

/* ---- Available now ---- */
.available-header-bg {
  background: var(--navy);
  padding: 20px 16px 24px;
  margin-bottom: -10px;
}

.available-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  font-weight: 500;
  margin-bottom: 8px;
}

/* ---- Conversation detail tabs ---- */
.conv-tabs {
  display: flex;
  background: var(--white);
  border-bottom: 1px solid var(--gray-150);
  flex-shrink: 0;
}

.conv-tabs .conv-tab {
  flex: 1;
  text-align: center;
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-400);
  cursor: pointer;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.conv-tabs .conv-tab.active {
  color: var(--navy);
  border-bottom-color: var(--navy);
  background: transparent;
  box-shadow: none;
}

/* ---- Conversations ---- */
.conv-header-tabs {
  display: flex;
  gap: 0;
  background: var(--off-white);
  padding: 4px;
  border-radius: var(--radius-md);
  margin: 0 16px 0;
}

.conv-tab {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.conv-tab.active {
  background: var(--white);
  color: var(--navy);
  box-shadow: var(--shadow-xs);
}

/* ---- Conversation detail ---- */
.chat-header {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-150);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.chat-header-info { flex: 1; }
.chat-header-name { font-size: 16px; font-weight: 700; color: var(--navy); }
.chat-header-status { font-size: 12px; color: var(--green); font-weight: 500; }

.chat-messages {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
}

.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.msg-row.sent { flex-direction: row-reverse; }

.msg-content { display: flex; flex-direction: column; max-width: 72%; align-items: flex-start; }
.msg-content.sent { align-items: flex-end; }

.msg-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: break-word;
  width: fit-content;
  min-width: 80px;
  max-width: 100%;
}

.msg-bubble.received {
  background: var(--white);
  color: var(--navy);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-xs);
}

.msg-bubble.sent {
  background: var(--navy);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.msg-time {
  font-size: 10px;
  color: var(--gray-400);
  margin-top: 3px;
  padding: 0 4px;
}

.msg-time.sent-time { text-align: right; }

.msg-row + .msg-row { margin-top: 6px; }

.msg-sender-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  margin-bottom: 4px;
  padding-left: 4px;
}

.guided-questions {
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  display: flex;
  gap: 8px;
  background: var(--off-white);
  border-bottom: 1px solid var(--gray-150);
}

.guided-questions::-webkit-scrollbar { display: none; }

.chat-input-wrap {
  position: sticky;
  bottom: 0;
  background: var(--white);
  border-top: 1px solid var(--gray-150);
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-input {
  flex: 1;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-full);
  padding: 10px 16px;
  font-size: 15px;
  color: var(--navy);
  outline: none;
  transition: var(--transition);
  background: var(--off-white);
}

.chat-input:focus { border-color: var(--navy); background: var(--white); }
.chat-input::placeholder { color: var(--gray-400); }

.chat-send-btn {
  width: 40px;
  height: 40px;
  background: var(--yellow);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  flex-shrink: 0;
}

.chat-send-btn:hover { transform: scale(1.05); background: var(--yellow-dark); }

/* ---- Groups page ---- */
.groups-hero {
  background: var(--navy);
  padding: 20px 16px 28px;
}

/* ---- Profile page ---- */
.profile-hero {
  background: var(--navy);
  padding: 24px 16px 32px;
  text-align: center;
  position: relative;
}

.profile-avatar-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 12px;
}

.profile-online-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: var(--green);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 2px solid var(--navy);
}

.profile-name {
  font-size: 24px;
  font-weight: 900;
  color: var(--white);
  margin-bottom: 4px;
}

.profile-activity {
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  margin-bottom: 10px;
}

.profile-defi-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin: 0 16px;
  margin-top: -16px;
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 5;
}

.profile-section {
  padding: 16px 16px 0;
}

.profile-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gray-400);
  margin-bottom: 10px;
}

/* ---- Kraft values banner ---- */
.kraft-values-banner {
  background: var(--navy);
  margin: 0 16px;
  border-radius: var(--radius-lg);
  padding: 16px;
}

.kraft-values-banner h4 { color: var(--white); margin-bottom: 12px; }

.kraft-value-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.kraft-value-item:last-child { margin-bottom: 0; }

.kraft-value-icon { font-size: 16px; margin-top: 1px; }
.kraft-value-text { font-size: 13px; color: rgba(255,255,255,0.75); }

/* ---- Responsive helpers ---- */
@media (max-width: 480px) {
  .hero-headline { font-size: 28px; }
  .match-card { min-height: 300px; }
}
