/* ═══════════════════════════════════════════
   NAV — Bottom navigation & Chat panel
   ═══════════════════════════════════════════ */

/* ─── Bottom Nav ─── */
#bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10,10,18,.95);
  backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
  border-top: 1px solid rgba(255,255,255,.04);
}
.nav-inner {
  display: flex; align-items: stretch; justify-content: space-around;
  max-width: 480px; margin: 0 auto; padding: 0 6px;
  padding-bottom: max(4px, env(safe-area-inset-bottom));
}
.nav-item {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; background: none; border: none;
  padding: 10px 0 8px; cursor: pointer; flex: 1; min-width: 0;
  position: relative; -webkit-tap-highlight-color: transparent;
}
.nav-item .nav-icon-wrap {
  width: 36px; height: 36px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: all .3s cubic-bezier(.34,1.56,.64,1); position: relative;
}
.nav-item.active .nav-icon-wrap { transform: translateY(-2px); }
.nav-item .nav-icon-wrap svg { width: 20px; height: 20px; transition: all .3s ease; }
.nav-item .nav-label { font-size: 10px; font-weight: 500; color: rgba(255,255,255,.3); transition: all .3s ease; }
.nav-item.active .nav-label { font-weight: 700; }
.nav-badge {
  position: absolute; top: 2px; right: 2px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #FF6B6B; border: 2px solid rgba(10,10,18,.95);
}

/* ─── Chat (inside Support Panel) ─── */
.chat-container {
  display: flex; flex-direction: column;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px; overflow: hidden;
  height: calc(100vh - 280px);
  min-height: 300px;
}
.chat-messages {
  flex: 1; overflow-y: auto; padding: 14px 12px;
  display: flex; flex-direction: column; gap: 8px;
  -webkit-overflow-scrolling: touch;
}
.msg { max-width: 80%; padding: 10px 14px; font-size: 13px; line-height: 1.5; font-weight: 500; word-break: break-word; }
.msg.bot { border-radius: 16px 16px 16px 4px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.06); color: rgba(255,255,255,.8); align-self: flex-start; }
.msg.user { border-radius: 16px 16px 4px 16px; background: linear-gradient(135deg, #7C4DFF, #7C4DFFcc); color: #fff; align-self: flex-end; }

.typing-dots { display: flex; gap: 5px; align-items: center; padding: 10px 16px; border-radius: 16px 16px 16px 4px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.06); align-self: flex-start; }
.typing-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.3); }
.typing-dots span:nth-child(1) { animation: typingDot 1.2s ease-in-out 0s infinite; }
.typing-dots span:nth-child(2) { animation: typingDot 1.2s ease-in-out .15s infinite; }
.typing-dots span:nth-child(3) { animation: typingDot 1.2s ease-in-out .3s infinite; }

.chat-input-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid rgba(255,255,255,.06); background: rgba(255,255,255,.02); flex-shrink: 0; }
.chat-input { flex: 1; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 10px 14px; color: #fff; font-size: 13px; font-family: 'DM Sans', sans-serif; outline: none; }
.chat-send { width: 38px; height: 38px; border-radius: 12px; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 16px; transition: all .25s ease; flex-shrink: 0; }

/* ─── Chat Attach Button ─── */
.chat-attach-btn {
  width: 38px; height: 38px; border-radius: 12px; border: none;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: rgba(255,255,255,.4); transition: all .25s ease;
  flex-shrink: 0;
}
.chat-attach-btn:active { background: rgba(124,77,255,.15); color: #7C4DFF; }

/* ─── Reply Preview Bar (above input) ─── */
.chat-reply-bar {
  display: flex; align-items: center; gap: 0;
  padding: 8px 12px; border-top: 1px solid rgba(255,255,255,.06);
  background: rgba(124,77,255,.06); flex-shrink: 0;
  animation: slideUp .2s ease both;
}
.reply-bar-accent {
  width: 3px; min-height: 32px; border-radius: 2px;
  background: #7C4DFF; flex-shrink: 0; margin-right: 10px;
}
.reply-bar-content { flex: 1; min-width: 0; }
.reply-bar-author {
  font-size: 11px; font-weight: 700; color: #7C4DFF;
  margin-bottom: 2px;
}
.reply-bar-text {
  font-size: 12px; color: rgba(255,255,255,.5);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.reply-bar-close {
  width: 24px; height: 24px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.4);
  font-size: 11px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; margin-left: 8px;
}
.reply-bar-close:active { background: rgba(255,82,82,.2); color: #FF5252; }

/* ─── Reply Quote inside Message ─── */
.msg-reply-quote {
  padding: 6px 10px; border-radius: 8px; margin-bottom: 6px;
  border-left: 3px solid #7C4DFF; cursor: pointer;
  max-width: 100%;
}
.msg.user .msg-reply-quote {
  background: rgba(255,255,255,.12);
}
.msg.bot .msg-reply-quote {
  background: rgba(255,255,255,.06);
}
.msg-reply-quote-author {
  font-size: 10px; font-weight: 700; color: #7C4DFF;
  margin-bottom: 1px;
}
.msg-reply-quote-text {
  font-size: 11px; color: rgba(255,255,255,.5);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 180px;
}
.msg-reply-quote-img {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: rgba(255,255,255,.5);
}
.msg-reply-quote-img img {
  width: 28px; height: 28px; border-radius: 6px; object-fit: cover;
}

/* ─── Reply Button on Hover/Tap ─── */
.msg-wrapper {
  display: flex; align-items: center; gap: 4px;
  max-width: 88%; position: relative;
}
.msg-wrapper.from-user { align-self: flex-end; flex-direction: row-reverse; }
.msg-wrapper.from-bot { align-self: flex-start; }
.msg-wrapper .msg { max-width: 100%; }
.msg-reply-btn {
  width: 26px; height: 26px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.06); color: rgba(255,255,255,.3);
  font-size: 12px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; opacity: 0;
  transition: opacity .2s ease;
}
.msg-wrapper:hover .msg-reply-btn,
.msg-wrapper.show-reply-btn .msg-reply-btn { opacity: 1; }
.msg-reply-btn:active { background: rgba(124,77,255,.2); color: #7C4DFF; }

/* ─── Chat Image Preview Bar ─── */
.chat-img-preview {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-top: 1px solid rgba(255,255,255,.06);
  background: rgba(124,77,255,.06); flex-shrink: 0;
}
.chat-img-preview-inner {
  position: relative; width: 56px; height: 56px; flex-shrink: 0;
}
.chat-img-preview-inner img {
  width: 56px; height: 56px; border-radius: 10px; object-fit: cover;
  border: 1px solid rgba(255,255,255,.1);
}
.chat-img-remove {
  position: absolute; top: -6px; right: -6px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #FF5252; border: 2px solid #0a0a12;
  color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; line-height: 1;
}
.chat-img-name {
  flex: 1; min-width: 0; font-size: 11px; color: rgba(255,255,255,.5);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: 'JetBrains Mono', monospace;
}

/* ─── Chat Image Message ─── */
.msg-img-wrap {
  max-width: 200px; border-radius: 12px; overflow: hidden;
  margin-bottom: 4px; cursor: pointer;
}
.msg-img-wrap img {
  width: 100%; display: block; border-radius: 12px;
}
.msg.user .msg-img-wrap { margin-left: auto; }

/* ─── Image Fullscreen Modal ─── */
.img-fullscreen {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.92); backdrop-filter: blur(20px);
  display: flex; align-items: center; justify-content: center;
  animation: chatFadeIn .2s ease both; cursor: pointer;
}
.img-fullscreen img {
  max-width: 92%; max-height: 85vh; border-radius: 12px;
  object-fit: contain; box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.img-fullscreen-close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15);
  color: #fff; font-size: 18px; display: flex; align-items: center;
  justify-content: center; cursor: pointer;
}
