/* assets/css/style.css */

:root {
  --bg: #121212;
  --card: #1e1e1e;
  --text: #e0e0e0;
  --accent: #6200ee;
  --panel: #1a1a1a;
  --border: #333;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

    /* Dark scrollbars */
    ::-webkit-scrollbar { width: 8px; height: 8px; background-color: #333; }
    ::-webkit-scrollbar-track { background-color: #2b2b2b; }
    ::-webkit-scrollbar-thumb { background-color: #555; border-radius: 4px; border: 2px solid #2b2b2b; }
    ::-webkit-scrollbar-thumb:hover { background-color: #777; }
    * { scrollbar-width: thin; scrollbar-color: #555 #2b2b2b; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Emoji","Segoe UI Symbol","Segoe UI",Roboto,sans-serif;
  /* Ensure content isn’t hidden behind the tabbar */
  padding-bottom: 56px;
  overflow-x: hidden;
}


/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel);
  padding: 0 1rem;
  z-index: 9999;
}
.hamburger i {
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10000;
}
.title {
  font-weight: bold;
  font-size: 1.25rem;
}
.icons a {
  position: relative;
  color: var(--text);
  text-decoration: none;
}
.icons i.fa-envelope {
  font-size: 1.5rem;
}
.has-unread::after {
  content: attr(data-count);
  position: absolute;
  top: -5px;
  right: -10px;
  background: red;
  color: #fff;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: .7rem;
}

/* Side panel */
.side-panel {
  position: fixed;
  top: 0;
  left: -250px;
  width: 250px;
  height: 100%;
  background: var(--panel);
  padding-top: 4rem;
  transition: left .3s ease;
  z-index: 2000;
}
.side-panel.open {
  left: 0;
}
.side-panel a {
  display: flex;
  align-items: center;
  padding: 1rem;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.side-panel a i {
  margin-right: .5rem;
}

/* Main & forms */
main {
  padding: 4rem 1rem 1rem;
}
.form-container {
  max-width: 400px;
  margin: 2rem auto;
  background: var(--card);
  padding: 2rem;
  border-radius: 8px;
}
.form-container input,
.form-container select,
.form-container textarea {
  width: 100%;
  padding: .8rem;
  margin-bottom: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
}
.form-container fieldset {
  border: 1px solid var(--border);
  padding: .5rem;
  margin-bottom: 1rem;
}
.form-container legend {
  padding: 0 .5rem;
  color: var(--text);
}
.form-container button {
  width: 100%;
  padding: .8rem;
  background: var(--accent);
  border: none;
  color: #fff;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
}

/* Profile grid & pull-to-refresh */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.profile-grid .card {
  position: relative;
  height: 200px;
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
}
.grid-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0,0,0,0.5);
  padding: .5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1;
}
.grid-title,
.grid-distance {
  color: #fff;
  font-weight: bold;
}
.online-indicator {
  position: absolute;
  top: .5rem;
  right: .5rem;
  width: 20px;
  height: 20px;
  background: #4caf50;
  border: 2px solid var(--panel);
  border-radius: 50%;
  z-index: 2;
}
.grid-last-active {
  position: absolute;
  top: .5rem;
  right: .5rem;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: .2rem .4rem;
  border-radius: 4px;
  font-size: .75rem;
  z-index: 2;
}

/* Favorites grid */
#favoritesGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

/* Chat list view */
.chat-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}
.chat-list-item {
  display: flex;
  align-items: center;
  background: var(--card);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.2s;
}
.chat-list-item:hover {
  background: #2a2a2a;
}
.chat-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
}
.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.chat-username {
  margin-left: 0.75rem;
  font-size: 1rem;
}
.chat-status {
  margin-left: auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.online-dot {
  background: #4caf50;
}
.offline-dot {
  background: #f44336;
}

/* Gallery preview (Edit Profile) */
.gallery-preview {
  display: flex;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.photo-container {
  position: relative;
}
.photo-container img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  margin: .25rem;
}
.delete-photo {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #f44336;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  z-index: 1;
}

/* View profile header */
.profile-header {
  position: relative;
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  margin-bottom: 1rem;
}
.profile-header h2 {
  position: absolute;
  bottom: .5rem;
  left: 1rem;
  color: #fff;
  text-shadow: 0 0 5px rgba(0,0,0,0.7);
  font-size: 1.5rem;
}
.distance-badge {
  position: absolute;
  bottom: .5rem;
  right: 1rem;
  background: rgba(0,0,0,0.5);
  color: #fff;
  padding: .3rem .6rem;
  border-radius: 4px;
  font-size: .9rem;
}
.view-profile-header .online-indicator {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 20px;
  height: 20px;
  background: #4caf50;
  border: 2px solid #fff;
  border-radius: 50%;
  z-index: 2;
}
.view-profile-header .last-active-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: .3rem .6rem;
  border-radius: 4px;
  font-size: .8rem;
  z-index: 2;
}

/* Gallery grid (View Profile) */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px,1fr));
  gap: .5rem;
  margin-top: 1rem;
}
.gallery-grid img {
  width: 100%;
  border-radius: 4px;
  cursor: pointer;
}



/* Make the chat container fill the available space and hide its overflow */
.chat-container {
  position: fixed;
  top: 56px;    
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 188px);
  overflow: hidden;
}

/* Only the messages panel scrolls */
/* .messages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem;
} */


/* Chat styles */
/* .chat-container {
  display: flex;
  left: 0;
  right: 0;
  flex-direction: column;
  height: calc(100vh - 56px - 56px);
  position: relative;
}  */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  -webkit-overflow-scrolling: touch;

  padding-bottom: 4rem;
}
.message {
  margin-bottom: 1rem;
}
.message.sent {
  text-align: right;
}
.message .text {
  display: inline-block;
  background: var(--card);
  padding: .5rem 1rem;
  border-radius: 16px;
  max-width: 70%;
  word-wrap: break-word;
}
.chat-input {
  position: absolute;
  bottom: 56px; /* above tabbar */
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  padding: 1rem;
  background: var(--panel);
  box-shadow: 0 -2px 5px rgba(0,0,0,0.5);
  z-index: 1000;
}
.chat-input input {
  flex: 1;
  padding: .8rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin: 0 .5rem;
  background: var(--bg);
  color: var(--text);
}
.chat-input button {
  padding: .8rem 1rem;
  background: var(--accent);
  border: none;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
}
.image-btn {
  border: none;
  background: var(--accent);
  color: #fff;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  cursor: pointer;
}

/* Tabbar */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 56px;
  background: var(--panel);
  display: flex;
  border-top: 1px solid var(--border);
  z-index: 1000;
}
.tabbar-button {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  font-size: .75rem;
  padding-top: 6px;
  position: relative;
}
.tabbar-button i {
  font-size: 1.5rem;
  display: block;
}
.tabbar-button.active {
  color: var(--accent);
}
.tabbar-badge {
  position: absolute;
  top: 4px;
  right: 30%;
  background: red;
  color: #fff;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: .6rem;
}

/* Fullscreen image viewer */
.image-viewer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999999;
}
.image-viewer-overlay img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
}
.image-viewer-overlay .close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  color: #fff;
  background: transparent;
  border: none;
  cursor: pointer;
}

/* ───────────────────────────────────────────────
   Install App Fullscreen Overlay
─────────────────────────────────────────────── */
.install-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  z-index: 999999;
}
.install-overlay.active {
  display: flex;
}
.install-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
}
.install-content {
  text-align: center;
  max-width: 300px;
  width: 100%;
  color: #fff;
}
.install-image {
  width: 100px;
  height: 100px;
  margin: 0 auto 1rem;
}
.install-text {
  font-size: 1rem;
  margin-bottom: 1.5rem;
}
.install-button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: .75rem 1.5rem;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
}
.install-button:hover {
  opacity: 0.9;
}
/* ───────────────────────────────────────────
   Chat‐List: Unread Message Badge
──────────────────────────────────────────── */
.chat-avatar {
  position: relative;
}
.chat-unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: red;
  color: #fff;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 0.7rem;
  line-height: 1;
  z-index: 2;
}
.no-chats {
  text-align: center;
  color: #888;
  margin-top: 2rem;
}

/* Prevent the <main> (and body) from scrolling on chat pages */
/* html, body, main {
  height: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
} */

.delete-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
}
.delete-dialog {
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  text-align: center;
  max-width: 90%;
}
.delete-dialog p {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}
.delete-dialog .btn {
  margin: 0 .5rem;
}
.hidden {
  display: none !important;
}

/* ─── Link styling for dark mode ─── */
a {
  color: var(--text);
  text-decoration: none;
  /*font-style: italic;*/
}

a:hover,
a:focus {
  color: var(--accent);
  text-decoration: none;
}

/* ─── Toggle-switch styles ─── */
.toggle-label {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
  color: var(--text);
  font-size: 1rem;
}

.toggle-text {
  margin-left: 0.75rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0;
  right: 0; bottom: 0;
  background: var(--border);
  border-radius: 34px;
  transition: background .3s;
}

.toggle-switch .slider::before {
  content: "";
  position: absolute;
  height: 16px; width: 16px;
  left: 2px; bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform .3s;
}

/* When checked, move the knob and change track color */
.toggle-switch input:checked + .slider {
  background: var(--accent);
}
.toggle-switch input:checked + .slider::before {
  transform: translateX(20px);
}

.leaflet-layer,
.leaflet-control-zoom-in,
.leaflet-control-zoom-out,
.leaflet-control-attribution {
  filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
}
.leaflet-container {
    background: #000
}
/* ─── Age verification / Map / Admin additions ─── */
.age-modal-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--accent);
}
.muted {
  color: #aaa;
  line-height: 1.4;
  margin-bottom: 1rem;
}
.small { font-size: .85rem; }
.error {
  color: #ff8a80;
  margin: .5rem 0 1rem;
}
.success {
  color: #7ee787;
  margin: .5rem 0 1rem;
}
.age-verification-container label {
  display: block;
  margin-bottom: .35rem;
  font-weight: 600;
}
.profile-verification-strip {
  max-width: 400px;
  margin: 0 auto 1rem;
  padding: 0 1rem;
}
.verified-pill,
.unverified-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border-radius: 999px;
  padding: .3rem .65rem;
  font-size: .8rem;
  font-weight: 700;
}
.verified-pill {
  background: rgba(76,175,80,.16);
  color: #8df59d;
  border: 1px solid rgba(76,175,80,.45);
}
.unverified-pill {
  background: rgba(255,193,7,.14);
  color: #ffd66b;
  border: 1px solid rgba(255,193,7,.4);
}
.map-page {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 56px;
}
.mapbox-full {
  width: 100%;
  height: 100%;
}
.profile-map-marker {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 3px solid #fff;
  background-size: cover;
  background-position: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.45);
  cursor: pointer;
  padding: 0;
  outline: none;
}
.profile-map-marker::after {
  content: '';
  position: absolute;
  inset: -7px;
  border: 2px solid rgba(98,0,238,.55);
  border-radius: 50%;
}
.admin-actions button + button {
  margin-top: .75rem;
}
.admin-container.wide {
  max-width: 900px;
}
.admin-search-form {
  display: grid;
  gap: .75rem;
}
.admin-user-list {
  max-width: 700px;
  margin: 1rem auto 5rem;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.admin-user-row {
  display: flex;
  align-items: center;
  gap: .9rem;
  background: var(--card);
  border: 1px solid var(--border);
  padding: .75rem;
  border-radius: 10px;
  color: var(--text);
}
.admin-user-row img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
}
.admin-user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.admin-user-meta span {
  color: #aaa;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.id-image-grid {
  max-width: 1000px;
  margin: 1rem auto 5rem;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.id-image-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
}
.id-image-card img {
  width: 100%;
  border-radius: 8px;
  margin-top: .75rem;
}
.map-overlay-content {
  max-width: 900px;
  height: 80vh;
}
.admin-map-container {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  overflow: hidden;
}
