@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=Source+Sans+3:wght@400;500;600;700&display=swap");

:root {
  --bg: #f6f7ff;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --text: #1b1b2b;
  --muted: #5f6582;
  --brand: #145ee8;
  --brand-strong: #0f45aa;
  --accent: #ff7a1a;
  --mint: #14c79e;
  --line: rgba(20, 39, 104, 0.14);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-soft: 0 16px 36px rgba(20, 36, 92, 0.12);
  --shadow-pop: 0 18px 42px rgba(20, 94, 232, 0.2);
  --header-bg: rgba(255, 255, 255, 0.62);
  --header-line: rgba(255, 255, 255, 0.5);
  --glow-a: rgba(20, 199, 158, 0.2);
  --glow-b: rgba(255, 122, 26, 0.18);
  --glow-c: rgba(20, 94, 232, 0.12);
}

:root[data-theme="dark"] {
  --bg: #090d1b;
  --surface: rgba(18, 24, 45, 0.8);
  --surface-strong: #111933;
  --text: #eef3ff;
  --muted: #a6b0d8;
  --brand: #69a0ff;
  --brand-strong: #3d78de;
  --accent: #ff9554;
  --mint: #36deb8;
  --line: rgba(161, 178, 236, 0.2);
  --shadow-soft: 0 18px 36px rgba(0, 0, 0, 0.32);
  --shadow-pop: 0 18px 42px rgba(36, 90, 194, 0.35);
  --header-bg: rgba(7, 11, 24, 0.66);
  --header-line: rgba(255, 255, 255, 0.12);
  --glow-a: rgba(54, 222, 184, 0.18);
  --glow-b: rgba(255, 149, 84, 0.16);
  --glow-c: rgba(105, 160, 255, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Source Sans 3", sans-serif;
  line-height: 1.55;
  overflow-x: hidden; /* Prevent background decorative elements from causing scroll */
  background:
    radial-gradient(
      circle at 8% 3%,
      var(--glow-a) 0%,
      rgba(20, 199, 158, 0) 30%
    ),
    radial-gradient(
      circle at 92% 0%,
      var(--glow-b) 0%,
      rgba(255, 122, 26, 0) 34%
    ),
    radial-gradient(
      circle at 50% 100%,
      var(--glow-c) 0%,
      rgba(20, 94, 232, 0) 55%
    ),
    var(--bg);
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(30px);
  opacity: 0.36;
  pointer-events: none;
}

body::before {
  width: 250px;
  height: 250px;
  left: -90px;
  top: 120px;
  background: linear-gradient(120deg, #14c79e, #145ee8);
  animation: floatA 10s ease-in-out infinite;
}

body::after {
  width: 320px;
  height: 320px;
  right: -120px;
  bottom: 120px;
  background: linear-gradient(120deg, #ff7a1a, #ffd428);
  animation: floatB 12s ease-in-out infinite;
}

h1,
h2,
h3,
.brand,
.btn,
.stat-card strong {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.02em;
}

.container {
  width: min(1140px, 92%);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--header-line);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.08rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-dot {
  width: 22px;
  height: 22px;
  border-radius: 0;
  background: url("logo-mark.svg") center/contain no-repeat;
  box-shadow: none;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  z-index: 50;
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu-btn.open .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.open .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.open .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.main-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  position: relative;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, var(--brand), var(--mint));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--text);
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after {
  transform: scaleX(1);
}

.hero {
  padding: 48px 0 24px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.36fr 1fr;
  gap: 32px;
  align-items: start;
}

.eyebrow {
  margin: 0;
  color: var(--brand);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

h1 {
  margin: 14px 0;
  line-height: 1.04;
  font-size: clamp(2.2rem, 5vw, 4rem);
  background: linear-gradient(100deg, #11172e, var(--brand) 48%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section-head h2 {
  margin: 6px 0 0;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.14;
}

.hero-copy {
  color: var(--muted);
  max-width: 62ch;
  font-size: 1.03rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.btn {
  border: none;
  padding: 11px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.96rem;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  filter: saturate(1.06);
}

.btn:active {
  transform: translateY(0);
}

.btn {
  background: linear-gradient(125deg, var(--brand), #3f89ff);
  color: #ffffff;
  box-shadow: var(--shadow-pop);
}

.btn-outline {
  background: transparent;
  color: var(--brand);
  border: 1.5px solid rgba(20, 94, 232, 0.4);
  box-shadow: none;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.58);
  color: var(--text);
  border: 1.2px solid rgba(20, 39, 104, 0.12);
  box-shadow: none;
}

.hero-panel {
  border-radius: calc(var(--radius) + 4px);
  padding: 28px;
  color: #f7fbff;
  background: linear-gradient(155deg, #111a43 0%, #145ee8 52%, #14c79e 104%);
  box-shadow: 0 20px 44px rgba(20, 94, 232, 0.3);
}

.hero-panel h2 {
  margin-top: 0;
}

.hero-panel ul {
  margin: 0;
  padding-left: 20px;
}

.hero-panel li {
  margin-bottom: 10px;
}

.section {
  padding: 32px 0;
}

.section-head {
  margin-bottom: 22px;
}

.section-head.left {
  margin-bottom: 10px;
}

.steps-grid,
.category-grid,
.listener-grid {
  display: grid;
  gap: 16px;
}

.steps-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.category-card,
.listener-card,
.booking-form,
.bookings-list article,
.admin-card,
.stat-card,
.chat-box,
.empty-state {
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.card,
.category-card,
.listener-card,
.bookings-list article,
.admin-card {
  padding: 20px;
}

.card,
.category-card,
.listener-card,
.bookings-list article,
.admin-card,
.stat-card {
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease;
}

.card:hover,
.category-card:hover,
.listener-card:hover,
.bookings-list article:hover,
.admin-card:hover,
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 46px rgba(20, 36, 92, 0.18);
}

.alt-bg {
  background: linear-gradient(
    180deg,
    rgba(20, 94, 232, 0.08) 0%,
    rgba(20, 94, 232, 0) 100%
  );
}

.category-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.listener-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.listener-card h3,
.listener-card p {
  margin: 0 0 8px;
}

.avatar {
  display: block;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(20, 94, 232, 0.2);
  background: rgba(255, 255, 255, 0.75);
}

.avatar-md {
  width: 56px;
  height: 56px;
  margin-bottom: 10px;
}

.avatar-lg {
  width: 88px;
  height: 88px;
  margin: 0 0 10px;
}

.avatar-xl {
  width: 120px;
  height: 120px;
}

.listener-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.listener-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.listener-tags span {
  background: linear-gradient(
    120deg,
    rgba(20, 94, 232, 0.12),
    rgba(20, 199, 158, 0.15)
  );
  color: #12346d;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.filter-group {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.filter-group label {
  font-size: 0.86rem;
  color: var(--muted);
}

.listener-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.category-listeners {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.listener-compact {
  padding: 12px;
  border: 1px solid rgba(20, 39, 104, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
}

.listener-compact p {
  margin: 0 0 6px;
}

.booking-section {
  background: linear-gradient(
    180deg,
    rgba(255, 122, 26, 0.07) 0%,
    rgba(255, 122, 26, 0) 100%
  );
}

.booking-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 24px;
}

.trust-points p {
  margin: 8px 0;
  color: var(--muted);
}

.booking-form {
  padding: 20px;
  display: grid;
  gap: 12px;
}

.booking-form h3 {
  margin: 0;
}

.booking-form label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

input,
select,
textarea {
  font: inherit;
  width: 100%;
  border: 1.5px solid rgba(20, 39, 104, 0.16);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(20, 94, 232, 0.58);
  box-shadow: 0 0 0 4px rgba(20, 94, 232, 0.16);
}

.inline-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#form-message,
#auth-message,
#reset-message,
#profile-message,
#location-status,
#listener-message {
  margin: 0;
  min-height: 24px;
  font-weight: 700;
}

.success {
  color: #0d8d68;
}

.error {
  color: #c23424;
}

.bookings-list {
  display: grid;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 8px;
}

.booking-item-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.empty-state {
  color: var(--muted);
  border-style: dashed;
  border-color: rgba(20, 39, 104, 0.2);
  padding: 18px;
}

.site-footer {
  border-top: 1px solid rgba(20, 39, 104, 0.12);
  padding: 28px 0 34px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  color: var(--muted);
}

.bookings-controls {
  margin-bottom: 14px;
}

.bookings-controls label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

.bookings-controls-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.header-actions .btn {
  padding: 7px 14px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.google-login-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.google-login {
  margin-top: 16px;
  margin-bottom: 8px;
}

.admin-layout {
  display: grid;
  gap: 16px;
}

.admin-table-wrap {
  overflow-x: auto;
  max-height: 560px;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid rgba(20, 39, 104, 0.08);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
  background: var(--surface-strong);
  border-radius: 12px;
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid rgba(20, 39, 104, 0.1);
  padding: 11px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  background: linear-gradient(
    120deg,
    rgba(20, 94, 232, 0.08),
    rgba(20, 199, 158, 0.09)
  );
  font-weight: 700;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  padding: 12px;
}

.stat-card p {
  margin: 0;
  color: var(--muted);
}

.stat-card strong {
  display: block;
  font-size: 1.35rem;
  margin-top: 3px;
}

.match-layout {
  display: grid;
  gap: 14px;
}

.chat-box {
  padding: 12px;
  min-height: 280px;
  max-height: 420px;
  overflow-y: auto;
}

.chat-row {
  margin-bottom: 10px;
}

.chat-row.mine {
  text-align: right;
}

.chat-bubble {
  display: inline-block;
  padding: 8px 11px;
  border-radius: 12px;
  background: linear-gradient(
    130deg,
    rgba(20, 94, 232, 0.12),
    rgba(20, 199, 158, 0.14)
  );
  max-width: 80%;
  word-break: break-word;
}

.chat-row.mine .chat-bubble {
  background: linear-gradient(
    130deg,
    rgba(255, 122, 26, 0.16),
    rgba(255, 212, 40, 0.2)
  );
}

.chat-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.peer-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.in-app-call {
  margin-top: 12px;
  border: 1px solid rgba(20, 39, 104, 0.12);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  overflow: hidden;
}

.in-app-call-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(20, 39, 104, 0.12);
}

.in-app-call iframe {
  width: 100%;
  min-height: 420px;
  border: 0;
  background: #05070f;
}

.rtc-stage {
  position: relative;
  min-height: 360px;
  background: #05070f;
}

.rtc-remote {
  width: 100%;
  min-height: 360px;
  max-height: 62vh;
  object-fit: cover;
  background: #05070f;
}

.rtc-local {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 180px;
  height: 120px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  object-fit: cover;
  background: #0b1226;
}

.match-immersive-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background:
    radial-gradient(circle at 20% 15%, rgba(37, 99, 235, 0.22), transparent 40%),
    radial-gradient(circle at 82% 85%, rgba(255, 146, 79, 0.2), transparent 38%),
    #05070f;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 18px;
  gap: 14px;
}

.match-overlay-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: rgba(11, 18, 38, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 14px 16px;
  color: #f4f6ff;
}

.match-overlay-top h3 {
  margin: 2px 0 6px;
}

.match-overlay-top p {
  margin: 0;
}

.match-overlay-stage {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #05070f;
}

.match-overlay-peer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(11, 18, 38, 0.6);
  color: #f4f6ff;
}

.overlay-peer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.match-overlay-peer-meta {
  display: grid;
  gap: 2px;
}

.overlay-chat-box {
  height: 120px;
  max-height: 120px;
  min-height: 120px;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 0;
}

.overlay-chat-form {
  margin: 0;
  grid-template-columns: 1fr auto;
}

.match-overlay-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(11, 18, 38, 0.7);
}

.match-overlay-controls .btn {
  min-height: 44px;
}

body.match-immersive-active .site-header,
body.match-immersive-active main {
  filter: blur(3px);
  pointer-events: none;
  user-select: none;
}

.profile-photo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}

@media (max-width: 768px) {
  .rtc-stage {
    min-height: 300px;
  }

  .rtc-remote {
    min-height: 300px;
    max-height: 52vh;
  }

  .rtc-local {
    width: 120px;
    height: 84px;
    right: 8px;
    bottom: 8px;
  }

  .match-immersive-overlay {
    padding: 10px;
    gap: 10px;
  }

  .match-overlay-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overlay-chat-box {
    height: 96px;
    max-height: 96px;
    min-height: 96px;
  }
}

a {
  color: var(--brand);
}

a:hover {
  color: var(--brand-strong);
}

.theme-toggle {
  min-width: 122px;
}

.has-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.has-icon::before {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  opacity: 0.9;
}

.icon-home::before {
  -webkit-mask-image: url("icons/home.svg");
  mask-image: url("icons/home.svg");
}
.icon-match::before {
  -webkit-mask-image: url("icons/match.svg");
  mask-image: url("icons/match.svg");
}
.icon-nearby::before {
  -webkit-mask-image: url("icons/nearby.svg");
  mask-image: url("icons/nearby.svg");
}
.icon-admin::before {
  -webkit-mask-image: url("icons/admin.svg");
  mask-image: url("icons/admin.svg");
}
.icon-chat::before {
  -webkit-mask-image: url("icons/chat.svg");
  mask-image: url("icons/chat.svg");
}
.icon-audio::before {
  -webkit-mask-image: url("icons/audio.svg");
  mask-image: url("icons/audio.svg");
}
.icon-video::before {
  -webkit-mask-image: url("icons/video.svg");
  mask-image: url("icons/video.svg");
}
.icon-history::before {
  -webkit-mask-image: url("icons/history.svg");
  mask-image: url("icons/history.svg");
}

/* Messages Hub Specific Styles */
.messages-main-wrap {
  height: calc(100vh - 120px);
  padding: 10px 0;
}

.messages-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  height: 100%;
  min-height: 0;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.messages-sidebar {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.4);
}

.messages-sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.messages-sidebar-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.messages-unread-chip {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  border-radius: 999px;
  padding: 2px 8px;
}

.conversation-list {
  flex: 1;
  overflow-y: auto;
}

.conversation-item {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid rgba(20, 39, 104, 0.05);
}

.conversation-item:hover {
  background: rgba(20, 94, 232, 0.04);
}

.conversation-item.active {
  background: rgba(20, 94, 232, 0.08);
  border-left: 4px solid var(--brand);
}

.conversation-item.unread .conv-name,
.conversation-item.unread .conv-last-msg {
  color: var(--text);
  font-weight: 700;
}

.conv-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--mint));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.conv-info {
  flex: 1;
  min-width: 0;
}

.conv-info-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.conv-name {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-time {
  font-size: 0.75rem;
  color: var(--muted);
}

.conv-last-msg {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-unread-dot {
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 8px;
}

.chat-main {
  display: flex;
  flex-direction: column;
  background: var(--surface-strong);
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.chat-main-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
  padding: 40px;
}

.chat-main-placeholder h3 {
  margin: 10px 0 0;
  color: var(--text);
}

.chat-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--header-bg);
}

.chat-peer-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-peer-name {
  font-weight: 700;
  font-size: 1.05rem;
}

.chat-active-ui {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.chat-active-ui .chat-header {
  flex-shrink: 0;
}

.chat-input-area {
  position: relative;
  background: var(--surface);
  box-shadow: none;
  box-sizing: border-box;
  flex-shrink: 0;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  align-items: center;
}

.chat-active-ui #message-form {
  display: flex !important;
  flex-shrink: 0;
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  min-height: 0;
  background:
    url("https://www.transparenttextures.com/patterns/cubes.png"),
    rgba(var(--surface-rgb), 0.98);
  background-blend-mode: overlay;
}

.call-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: #000;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.call-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.video-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  position: relative;
  background: #000;
  overflow: hidden;
}

.video-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-wrapper.local {
  position: absolute;
  bottom: 100px;
  right: 20px;
  width: 150px;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--primary);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 10;
  background: #222;
}

.video-label {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  backdrop-filter: blur(4px);
  z-index: 5;
}

.call-actions {
  position: absolute;
  bottom: 24px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 0 20px;
  z-index: 20;
}

.circle-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.25rem;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.circle-btn:hover {
  transform: scale(1.1);
}

.circle-btn.btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  backdrop-filter: blur(8px);
}

.circle-btn.btn-danger {
  background: #ff4757;
  color: #fff;
}

@media (max-width: 768px) {
  .messages-main-wrap {
    height: calc(100dvh - 120px);
    min-height: 0;
    padding: 6px 0;
  }

  .messages-layout {
    grid-template-columns: 1fr;
    height: 100%;
  }
  .messages-sidebar.hidden-mobile {
    display: none;
  }
  .chat-main.hidden-mobile {
    display: none;
  }
}
.icon-logout::before {
  -webkit-mask-image: url("icons/logout.svg");
  mask-image: url("icons/logout.svg");
}
.icon-spark::before {
  -webkit-mask-image: url("icons/spark.svg");
  mask-image: url("icons/spark.svg");
}

.reveal {
  opacity: 0;
  transform: translateY(22px) scale(0.985);
  transition:
    opacity 0.55s ease,
    transform 0.55s ease;
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@keyframes floatA {
  0%,
  100% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(-16px) translateX(10px);
  }
}

@keyframes floatB {
  0%,
  100% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(16px) translateX(-12px);
  }
}

@media (max-width: 980px) {
  .nav-wrap {
    flex-wrap: wrap;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .main-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: fixed;
    top: 60px;
    left: -100%;
    width: 250px;
    height: calc(100vh - 60px);
    background: var(--surface-strong); /* solid background for better contrast */
    border-right: 1px solid var(--header-line);
    padding: 32px 24px;
    gap: 32px;
    transition: left 0.3s ease;
    z-index: 40;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08); /* softer, wider shadow */
  }

  .main-nav a {
    font-size: 1.15rem; /* much larger and easier to tap */
    color: var(--text); /* darker, higher contrast */
    font-weight: 700;
  }

  .main-nav.open {
    left: 0;
  }

  .hero-grid,
  .steps-grid,
  .category-grid,
  .listener-grid,
  .booking-layout,
  .footer-grid,
  .filter-bar,
  .auth-grid,
  .admin-form-grid,
  .stats-grid,
  .chat-controls,
  .bookings-controls-row {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }

  /* Header mobile constraints */
  .header-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
    flex-wrap: nowrap;
  }
  
  /* Hide text for specific buttons on very small screens to prevent overflow */
  @media (max-width: 480px) {
    .header-actions .btn .btn-text {
      display: none !important;
    }
    .header-actions .btn {
      padding: 8px !important;
      min-width: unset !important;
    }
  }
  
  .theme-toggle {
    min-width: unset !important;
    padding: 8px 12px !important;
  }

  .theme-toggle .btn-text {
    display: none !important;
  }

  .nav-wrap {
    gap: 8px;
  }

  .brand {
    font-size: 0.95rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

#profile-modal {
  z-index: 1305;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--surface);
  padding: 32px;
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.modal-sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
}

/* Badges */
.badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-block;
}

.badge-busy {
  background: rgba(255, 59, 48, 0.1);
  color: #ff3b30;
  border: 1px solid rgba(255, 59, 48, 0.2);
}

.badge-available {
  background: rgba(52, 199, 89, 0.1);
  color: #34c759;
  border: 1px solid rgba(52, 199, 89, 0.2);
}

.listener-status-header {
  margin-bottom: 12px;
}

.table-controls {
  margin-bottom: 15px;
  display: flex;
  justify-content: flex-end;
}

.table-search {
  max-width: 300px;
  padding: 8px 12px;
  font-size: 0.9rem;
}

.table-pagination {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.table-pagination-meta {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.table-pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-pagination-page {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.nav-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: #e63b52;
}

.inapp-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1200;
  background: #0f45aa;
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.inapp-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.nearby-requests-wrap {
  max-height: 420px;
  overflow-y: auto;
}

.nearby-compact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.nearby-mini-card {
  border: 1px solid rgba(20, 39, 104, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 12px;
}

.nearby-mini-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(20, 94, 232, 0.24);
  flex: 0 0 auto;
}

.nearby-mini-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.nearby-mini-meta strong,
.nearby-mini-meta small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nearby-mini-meta small {
  color: var(--muted);
}

.nearby-mini-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nearby-mini-actions select {
  min-width: 120px;
  max-width: 140px;
}

.nearby-mini-actions .btn {
  min-height: 36px;
  padding: 8px 16px;
}

@media (max-width: 768px) {
  .nearby-mini-card {
    grid-template-columns: 48px 1fr;
    gap: 10px;
  }

  .nearby-mini-avatar {
    width: 44px;
    height: 44px;
  }

  .nearby-mini-actions {
    grid-column: 2;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

.sort-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-weight: bold;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.sort-btn::after {
  content: "↕";
  opacity: 0.3;
}
.sort-btn.sort-asc::after {
  content: "↑";
  opacity: 1;
}
.sort-btn.sort-desc::after {
  content: "↓";
  opacity: 1;
}

/* ── Tab Navigation ─────────────────────────────── */
.tab-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 2px solid rgba(20, 39, 104, 0.1);
  margin-bottom: 24px;
  padding-bottom: 0;
}

.tab-btn {
  background: none;
  border: none;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.tab-btn:hover {
  color: var(--body);
  background: rgba(20, 39, 104, 0.05);
}

.tab-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  background: rgba(20, 94, 232, 0.06);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* ── Streak Widget ───────────────────────────────── */
.streak-widget {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(255, 140, 0, 0.08), rgba(255, 80, 0, 0.04));
  border: 1px solid rgba(255, 140, 0, 0.25);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-top: 16px;
}

.streak-flame {
  font-size: 2rem;
  line-height: 1;
}

.streak-info strong {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: #e06000;
}

.streak-info small {
  color: var(--muted);
  font-size: 0.82rem;
}

.streak-milestones {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.milestone-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(20, 94, 232, 0.08);
  color: var(--brand);
  border: 1px solid rgba(20, 94, 232, 0.2);
}

.milestone-badge.earned {
  background: rgba(13, 141, 104, 0.12);
  color: #0d8d68;
  border-color: rgba(13, 141, 104, 0.25);
}

/* ── Anonymity Toggle ────────────────────────────── */
.anon-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(20, 39, 104, 0.04);
  border: 1px solid rgba(20, 39, 104, 0.1);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  cursor: pointer;
  margin: 8px 0;
}

.anon-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}

/* ── 24hr Badge ──────────────────────────────────── */
.followup-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #0d8d68;
  background: rgba(13, 141, 104, 0.08);
  border: 1px solid rgba(13, 141, 104, 0.2);
  border-radius: 999px;
  padding: 3px 10px;
  font-weight: 600;
}

.followup-badge::before {
  content: "⏰";
}

/* Profile Tabbed Layout */
.profile-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: start;
}

.profile-sidebar {
  position: sticky;
  top: 100px;
}

.profile-tabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.profile-tab-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.profile-tab-btn:hover {
  background: rgba(20, 94, 232, 0.05);
  color: var(--text);
}

.profile-tab-btn.active {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-pop);
}

.profile-tab-btn .icon {
  font-size: 1.2rem;
}

.profile-tab-content {
  display: none;
}

.profile-tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  .profile-layout {
    grid-template-columns: 1fr;
    min-width: 0;
  }
  
  .profile-sidebar {
    position: static;
    max-width: 100%;
    overflow: hidden;
  }
  
  .profile-tabs {
    flex-direction: row;
    overflow-x: auto;
    padding: 8px;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    border-radius: var(--radius-sm);
  }
  
  .profile-tab-btn {
    padding: 8px 16px;
    flex-shrink: 0;
  }

  /* Form and card fixes for mobile */
  .admin-card {
    padding: 20px;
    overflow-x: hidden;
  }

  .admin-form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  input, select, textarea {
    max-width: 100% !important;
  }
}
