:root {
  --bg-color: #FFFFFF;
  --text-color: #000000;
  --sub-text-color: #6B6B6B;
  --left-msg-bg: #EFF3F4;
  --notification-alert-bg: #2F3336;
  --app-color: #06853A;
  --deep-app-color: #044012;
  --down-icon-box-shadow-1: rgba(0, 0, 0, 0.2);
  --down-icon-box-shadow-2: rgba(0, 0, 0, 0.1);
  --light-bg-color: rgba(0, 0, 0, 0.4);
  --light-app-color: #E9F8F5;
  --inactive-option-bg: rgba(239, 243, 244, 0.6);
  --active-option-bg: rgba(0, 160, 130, 0.5);
  --skeleton-base: rgba(0, 0, 0, 0.08);
  --skeleton-highlight: rgba(255, 255, 255, 0.6);
}

html.dark-mode {
  --bg-color: #0B0E0C;
  --sub-text-color: #8E9894;
  --left-msg-bg: #1A201D;
  --app-color: #0A9B47;
  --deep-app-color: #067A38;
  
  --text-color: #FFFFFF;
  --notification-alert-bg: #EFF3F4;
  --down-icon-box-shadow-1: rgba(255, 255, 255, 0.1);
  --down-icon-box-shadow-2: rgba(255, 255, 255, 0.05);
  --light-bg-color: rgba(255, 255, 255, 0.4);
  --light-app-color: #E9F8F5;
  --inactive-option-bg: rgba(47, 51, 54, 0.5);
  --active-option-bg: rgba(0, 160, 130, 0.5);
  --skeleton-base: rgba(255, 255, 255, 0.08);
  --skeleton-highlight: rgba(255, 255, 255, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif; }
body { font-weight: 400; }
button, input, select, textarea { font-family: inherit; font-weight: inherit; }
h1, h2, h3, h4, h5, h6, b, strong { font-weight: 600; }

a {
  text-decoration: none;
  color: var(--app-color);
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  user-select: none;
}

.chat-list-skeleton {
  background: var(--bg-color);
  padding: 10px;
  min-height: 100vh;
}

.chat-skeleton-item {
  height: 70px;
  border-radius: 14px;
  margin-bottom: 12px;

  background: linear-gradient(
    90deg,
    var(--skeleton-base) 25%,
    var(--skeleton-highlight) 37%,
    var(--skeleton-base) 63%
  );

  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.action-button {
  padding: 8px 16px;
  font-size: 16px;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  margin: 10px;
  background-color: var(--app-color);
  color: white;
  transition:
    background-color 0.3s ease,
    transform 0.2s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.action-button:hover {
  background-color: var(--deep-app-color);
  transform: translateY(-2px);
}

.submit-btn {
  padding: 8px 16px;
  font-size: 16px;
  margin: 0 auto;
  width: 100%;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  background-color: var(--app-color);
  color: white;
  transition:
    background-color 0.3s ease,
    transform 0.2s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.submit-btn:hover {
  background-color: var(--deep-app-color);
  transform: translateY(-2px);
}

.fixed-action-button {
  position: fixed;
  bottom: 22%;
  right: 10px;
  width: 50px;
  height: 50px;
  background-color: var(--app-color);
  border-radius: 50%;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 3;
  transition: background-color 0.3s ease;
}

.fixed-action-button svg {
  position: absolute;
  transform: translate(-50%, -50%);
  bottom: 4%;
  right: 50%;
  left: 45%;
}

.fixed-action-button:hover {
  background-color: var(--deep-app-color);
  transform: translateY(-2px);
}

::-webkit-scrollbar {
  width: 6px;
  background-color: #f5f5f5;
  border-radius: 20px;
}

::-webkit-scrollbar-thumb {
  background-color: var(--app-color);
  border-radius: 20px;
}

@media (max-device-width: 768px) {
  ::-webkit-scrollbar {
    display: none;
  }
}

.loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background-color: var(--text-color);
  z-index: 10000;
  animation: loading 2s linear infinite;
}

@keyframes loading {
  0% {
    width: 0;
  }
  100% {
    width: 100%;
  }
}

.preloader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  justify-content: center;
  align-items: center;
  display: none;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  height: 60px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--bg-color);
  color: var(--text-color);
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.1);
  z-index: 800;
}

.avatar {
  cursor: pointer;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--avatar-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  text-align: center;
  margin: 0 10px;
  position: absolute;
  right: 0px;
}

#in-app-notification {
  position: fixed;
  top: 10%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--bg-color);
  background-color: var(--notification-alert-bg);
  width: 95%;
  font-size: 15px;
  padding: 6px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  text-align: center;
  border-radius: 10px;
  display: none;
  z-index: 99999;
}

.notification-alert,
.password-mismatch-alert {
  position: fixed;
  top: 10%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--bg-color);
  background-color: var(--notification-alert-bg);
  width: 95%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-size: 15px;
  padding: 5px;
  text-align: center;
  border-radius: 10px;
  display: none;
  z-index: 99999;
}

.anonymous-chat-alert {
  position: fixed;
  top: 15%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--bg-color);
  background-color: var(--notification-alert-bg);
  width: 95%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-size: 15px;
  padding: 5px;
  text-align: center;
  border-radius: 10px;
  display: none;
  z-index: 99999;
}

.page-header {
  font-weight: 700;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
}

.page-header-ellipsis {
  color: var(--text-color);
  font-size: 25px;
  cursor: pointer;
  right: 10px;
  position: absolute;
}

.page-header-back-arrow {
  color: var(--text-color);
  font-size: 25px;
  cursor: pointer;
  position: absolute;
  left: 20px;
}

.bottom-nav {
  padding: 10px 1px;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 10%;
  display: flex;
  align-items: center;
  justify-content: space-around;
  border-top: 1px solid #666;
  background-color: var(--bg-color);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--sub-text-color);
  text-align: center;
}

.nav-item a {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--sub-text-color);
}

.nav-item svg {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
}

.nav-item span {
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
}

#active {
  color: var(--app-color);
}

.floating-input-content {
  width: 100%;
  position: relative;
}

.floating-input {
  font-size: 14px;
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 10px;
  caret-color: var(--app-color);
  background: var(--bg-color);
  color: var(--text-color);
  border: 1px solid var(--app-color);
  border-radius: 10px;
  box-sizing: border-box;

  &:focus {
    outline: none;
    border: 2px solid var(--app-color);

    ~ .floating-label {
      top: -8px;
      font-size: 13px;
      color: var(--app-color);
    }
  }
}

.floating-input:not(:placeholder-shown) ~ .floating-label {
  top: -8px;
  font-size: 13px;
}

.floating-input-error {
  font-size: 14px;
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 10px;
  caret-color: var(--app-color);
  background: var(--bg-color);
  color: var(--text-color);
  border: 1px solid red;
  border-radius: 10px;
  box-sizing: border-box;

  &:focus {
    outline: none;
    border: 2px solid red;

    ~ .floating-label {
      top: -8px;
      font-size: 13px;
      color: red;
    }
  }
}

.floating-input-error:not(:placeholder-shown) ~ .floating-label {
  top: -8px;
  font-size: 13px;
}

.floating-textarea-content {
  position: relative;
  width: 100%;
  margin-top: 10px;
}

.floating-textarea {
  font-size: 14px;
  display: block;
  width: 100%;
  height: 80px;
  padding: 6px 10px;
  caret-color: var(--app-color);
  background: var(--bg-color);
  color: var(--text-color);
  border: 1px solid var(--app-color);
  border-radius: 10px;
  resize: none;
  box-sizing: border-box;

  &:focus {
    outline: none;
    border: 2px solid var(--app-color);

    ~ .floating-label {
      top: -8px;
      font-size: 13px;
      color: var(--app-color);
    }
  }
}

.floating-textarea:not(:placeholder-shown) ~ .floating-label {
  top: -8px;
  font-size: 13px;
}

.floating-label {
  color: var(--text-color);
  font-size: 13px;
  font-weight: normal;
  position: absolute;
  pointer-events: none;
  left: 12px;
  top: 10px;
  padding: 0 5px;
  background: var(--bg-color);
  transition: 0.2s ease all;
  -moz-transition: 0.2s ease all;
  -webkit-transition: 0.2s ease all;
}

.hand-icon {
  font-size: 40px;
  text-align: center;
  color: var(--app-color);
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 1.5s infinite;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(20px);
  }

  60% {
    transform: translateY(10px);
  }
}

.empty-filter-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
}
.view-all-messages {
  color: var(--app-color);
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
}


/* ==========================================================
   MODERN POLISH (overrides only; delete this block to revert)
   ========================================================== */
:root {
  --line-color: rgba(0, 0, 0, 0.08);
  --shadow-pop: 0 10px 30px rgba(0, 0, 0, 0.18);
}
html.dark-mode {
  --line-color: rgba(255, 255, 255, 0.12);
  --shadow-pop: 0 10px 30px rgba(0, 0, 0, 0.6);
}

html { -webkit-text-size-adjust: 100%; }
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
:focus-visible { outline: 2px solid var(--app-color); outline-offset: 2px; }

/* ---- Top bar ---- */
#top-nav-bar { box-shadow: none; border-bottom: 1px solid var(--line-color); }
.page-header { letter-spacing: -0.01em; }
.page-header-back-arrow {
  left: 10px; width: 43px; height: 45px; padding: 10px; border-radius: 50%;
}
.page-header-ellipsis {
  right: 4px; width: 44px; height: 44px; padding: 7px; border-radius: 50%;
}
.page-header-back-arrow:active,
.page-header-ellipsis:active { background-color: var(--left-msg-bg); }

/* ---- Bottom bar ---- */
.bottom-nav {
  height: 10%;              /* keep at 10%: your fixed ads sit at bottom: 10% */
  min-height: 0;
  padding: 0 4px env(safe-area-inset-bottom, 0px);
  align-items: stretch;
  border-top: 1px solid var(--line-color);
}
.nav-item { position: relative; flex: 1; justify-content: center; transition: transform 0.15s ease; }
.nav-item a { flex: 1; width: 100%; justify-content: center; }   /* whole tab is the link */
.nav-item:active { transform: scale(0.94); }
.nav-item.active::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  width: 28px; height: 3px; margin-left: -14px;
  border-radius: 0 0 3px 3px;
  background: var(--app-color);
}

/* Frosted bars (only where the browser supports it) */
@supports (backdrop-filter: blur(1px)) and (background: color-mix(in srgb, red, blue)) {
  #top-nav-bar,
  .bottom-nav {
    background-color: color-mix(in srgb, var(--bg-color) 82%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    backdrop-filter: saturate(180%) blur(18px);
  }
}

/* ---- Toasts ---- */
#in-app-notification,
.notification-alert,
.password-mismatch-alert,
.anonymous-chat-alert {
  max-width: 420px;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: var(--shadow-pop);
}

/* ---- Buttons ---- */
.action-button,
.submit-btn {
  font-weight: 600;
  letter-spacing: -0.005em;
  box-shadow: none;
  transition: background-color 0.2s ease, transform 0.15s ease;
}
.action-button:hover,
.submit-btn:hover { transform: none; }
.action-button:active,
.submit-btn:active { transform: scale(0.98); }
.action-button:disabled,
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.fixed-action-button { box-shadow: 0 8px 20px rgba(6, 133, 58, 0.35); transition: background-color 0.2s ease, transform 0.15s ease; }
.fixed-action-button:hover { transform: none; }
.fixed-action-button:active { transform: scale(0.94); }

/* ---- Scrollbar and loader ---- */
::-webkit-scrollbar { background-color: transparent; }
::-webkit-scrollbar-thumb { background-color: rgba(128, 128, 128, 0.45); }
::-webkit-scrollbar-thumb:hover { background-color: var(--app-color); }
.loading-bar { background-color: var(--app-color); }

@media (prefers-reduced-motion: reduce) {
  .hand-icon { animation: none; }
  .nav-item, .action-button, .submit-btn, .fixed-action-button { transition: none; }
}

/* ---- Tokens ---- */
:root {
  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 15px; --fs-lg: 17px; --fs-xl: 20px;
  --radius-sm: 10px; --radius-md: 14px; --radius-lg: 20px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---- Type ---- */
.page-header {
  font-size: var(--fs-lg);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  max-width: calc(100% - 112px);
}
.nav-item.active span { font-weight: 600; }
.nav-item.active svg { stroke-width: 2; }
.view-all-messages { font-size: 16px; font-weight: 600; }

/* ---- Interaction ---- */
input, textarea, [contenteditable="true"] { -webkit-user-select: text; user-select: text; }
a, button, [role="button"], .nav-item, .action-button, .submit-btn { touch-action: manipulation; }

/* ---- Toasts ---- */
#in-app-notification { animation: toast-in 0.25s var(--ease) both; }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% - 10px)); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}
#in-app-notification i { vertical-align: -2px; }
#in-app-notification.success i { color: #22c55e; }
#in-app-notification.error i   { color: #ef4444; }
#in-app-notification.info i    { color: #3b82f6; }
#in-app-notification.network i { color: #f59e0b; }

/* ---- Floating action button ---- */
.fixed-action-button {
  width: 56px; height: 56px;
  right: 16px;
  bottom: calc(10% + 86px);   /* 16px above your fixed ad bar (10% + 70px) */
}
.fixed-action-button svg {
  position: absolute; top: 50%; left: 50%;
  right: auto; bottom: auto; margin: 0;
  transform: translate(-50%, -50%);   /* centers even when JS sets display:block */
}

/* ---- Loader ---- */
.preloader-overlay { background-color: rgba(0, 0, 0, 0.2); }
.loading-bar { animation-duration: 1.4s; animation-timing-function: var(--ease); }