/* ===================================
   💜 AMORAAI CHAT INTERFACE (FINAL POLISHED BUILD)
   =================================== */

#chatSection {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: stretch;
  background: radial-gradient(circle at 30% 20%, rgba(18, 9, 27, 1) 0%, rgba(10, 5, 15, 0.98) 85%);
  backdrop-filter: blur(10px);
  z-index: 5000;
  opacity: 0.99;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
#chatSection.active {
  display: flex !important;
  opacity: 1;
  pointer-events: auto;
}

/* ===================================
   WRAPPER
   =================================== */
#chatSection .chat-wrapper {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* ===================================
   🧩 LEFT CHARACTER PANEL
   =================================== */
#chatSection .character-list {
  flex: 0 0 auto;
  width: clamp(300px, 26vw, 400px);
  background: rgba(15, 8, 25, 0.97);
  box-shadow: 4px 0 25px rgba(255, 0, 130, 0.08);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  transition: width 0.3s ease;
}
#chatSection .character-list-header {
  padding: 14px 10px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 0, 120, 0.1);
  background: rgba(25, 10, 30, 0.9);
}
#chatSection .character-list-header h3 {
  color: #ffb8dc;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  margin: 0;
}
#chatSection .character-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  justify-items: center;
  align-content: start;
}
#chatSection .character-scroll::-webkit-scrollbar {
  width: 6px;
}
#chatSection .character-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 0, 130, 0.25);
  border-radius: 10px;
}

/* Character Card */
#chatSection .character-card {
  width: 180px;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 0, 120, 0.15);
  background: rgba(30, 10, 35, 0.65);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.3s ease;
}
#chatSection .character-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: rgba(20, 10, 30, 0.6);
}
#chatSection .character-card p {
  color: #ffb8dc;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  background: rgba(15, 5, 25, 0.85);
  width: 100%;
  padding: 5px 0;
  margin: 0;
}
#chatSection .character-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 0, 160, 0.6);
  box-shadow: 0 0 15px rgba(255, 0, 150, 0.3);
}
#chatSection .character-card.active {
  border-color: rgba(255, 0, 160, 0.9);
  box-shadow: 0 0 18px rgba(255, 0, 150, 0.4);
}

/* ===================================
   💬 CENTER CHAT CONTAINER
   =================================== */
#chatSection .chat-container {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(15, 8, 20, 0.9);
  border-right: 1px solid rgba(255, 0, 120, 0.1);
  overflow: hidden;
}
#chatSection .chat-container::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--chat-bg-image) center/cover no-repeat;
  opacity: 0.98;
  filter: blur(2px);
  z-index: 0;
}
#chatSection .chat-container::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10, 5, 15, 0.2) 0%, rgba(10, 5, 15, 0.5) 100%);
  z-index: 0;
}
#chatSection .chat-header,
#chatSection .chat-messages,
#chatSection .chat-input-container {
  position: relative;
  z-index: 1;
}

/* Header */
#chatSection .chat-header {
  height: 64px;
  background: rgba(25, 10, 30, 0.88);
  border-bottom: 1px solid rgba(255, 0, 120, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}
#chatSection .chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
#chatSection .chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 0, 100, 0.4);
  object-fit: cover;
}
#chatSection .chat-name {
  color: #ffb8dc;
  font-weight: 600;
  font-size: 1rem;
}

/* Messages */
#chatSection .chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 25px 30px;
  color: #fff;
  scroll-behavior: smooth;
}
#chatSection .chat-messages::-webkit-scrollbar {
  width: 6px;
}
#chatSection .chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 0, 120, 0.25);
  border-radius: 10px;
}

/* Input */
#chatSection .chat-input-container {
  background: rgba(20, 8, 25, 0.85);
  border-top: 1px solid rgba(255, 0, 120, 0.1);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
#chatSection .chat-input {
  flex: 1;
  background: rgba(40, 20, 40, 0.5);
  border: 1px solid rgba(255, 0, 120, 0.2);
  color: #fff;
  border-radius: 25px;
  padding: 12px 18px;
}
#chatSection .chat-input:focus {
  border-color: rgba(255, 0, 150, 0.4);
}
#chatSection .send-btn {
  background: linear-gradient(90deg, #ff007f, #c83df7);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.2s ease;
}
#chatSection .send-btn:hover {
  transform: scale(1.1);
}

/* ===================================
   💜 RIGHT PROFILE PANEL
   =================================== */
#chatSection .character-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 0, 120, 0.15);
  background: rgba(30, 10, 35, 0.65);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.3s ease;
}
#chatSection .profile-content {
  width: 100%;
  max-width: 360px;
  background: linear-gradient(180deg, rgba(35, 15, 45, 0.95), rgba(15, 5, 25, 0.95));
  border: 1px solid rgba(255, 0, 130, 0.15);
  border-radius: 20px;
  padding: 25px 20px 30px;
  text-align: center;
  box-shadow: 0 0 35px rgba(255, 0, 130, 0.12);
}

/* Profile Avatar */
#chatSection #profileAvatar {
  width: 100%;
  height: 300px;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid rgba(255, 0, 120, 0.25);
  box-shadow: 0 0 25px rgba(255, 0, 130, 0.25);
  margin-bottom: 18px;
}

/* Gallery Section */
#chatSection .profile-gallery {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 6px 0;
  margin-bottom: 20px;
  scroll-behavior: smooth;
}
#chatSection .profile-gallery::-webkit-scrollbar {
  height: 6px;
}
#chatSection .profile-gallery::-webkit-scrollbar-thumb {
  background: rgba(255, 0, 130, 0.25);
  border-radius: 10px;
}
#chatSection .gallery-item {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  cursor: pointer;
}
#chatSection .gallery-thumb {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255, 0, 120, 0.15);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
#chatSection .gallery-thumb:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(255, 0, 130, 0.4);
}
#chatSection .gallery-thumb.blurred {
  filter: blur(6px) brightness(0.6);
  pointer-events: none;
}
#chatSection .lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  font-size: 1.8rem;
  border-radius: 10px;
  pointer-events: none;
}

/* ===============================
   💎 PAYMENT POPUP — VIOLET NEON STYLE
   =============================== */

.payment-popup h3 {
  font-size: 1.2rem;
  color: #fff;
  font-weight: 700;
  margin-bottom: 8px;
}

.payment-popup p {
  font-size: 0.95rem;
  color: #e8c4d8;
  margin-bottom: 20px;
  line-height: 1.4;
}

.payment-popup .btn-pay,
.payment-popup .btn-close {
  border: none;
  border-radius: 25px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0 6px;
}

/* Unlock Now button */
.payment-popup .btn-pay {
  background: linear-gradient(90deg, #ff007f, #c83df7);
  color: #fff;
  box-shadow: 0 0 15px rgba(255, 0, 150, 0.4);
}
.payment-popup .btn-pay:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(255, 0, 180, 0.6);
}

/* Maybe Later button */
.payment-popup .btn-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ccc;
}
.payment-popup .btn-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

@keyframes popupIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}


/* 💎 AMORAAI GLOBAL LIGHTBOX GALLERY */
#amoraGalleryModal {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(5, 0, 10, 0.92);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  z-index: 999999 !important;
  pointer-events: none;
}

#amoraGalleryModal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Inner container */
#amoraGalleryModal .lightbox-content {
  position: relative;
  background: linear-gradient(180deg, rgba(35, 15, 45, 0.95), rgba(15, 5, 25, 0.95));
  border: 2px solid rgba(255, 0, 150, 0.4);
  box-shadow: 0 0 40px rgba(255, 0, 130, 0.35);
  border-radius: 14px;
  padding: 25px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  max-width: 90vw;
  max-height: 90vh;
}

/* Image inside lightbox */
#amoraGalleryModal img {
  max-width: 85vw;
  max-height: 80vh;
  border-radius: 12px;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#amoraGalleryModal.active img {
  opacity: 1;
  transform: scale(1);
}

/* Navigation arrows */
#amoraGalleryModal .gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 2.8rem;
  padding: 12px 24px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1000000;
  transition: background 0.3s ease, transform 0.2s ease;
}
#amoraGalleryModal .gallery-nav:hover {
  background: rgba(255, 0, 150, 0.35);
  transform: translateY(-50%) scale(1.1);
}
#amoraGalleryModal .gallery-nav.prev { left: 30px; }
#amoraGalleryModal .gallery-nav.next { right: 30px; }

/* Close button */
#amoraGalleryModal .close-gallery {
  position: absolute;
  top: 15px;
  right: 25px;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  z-index: 1000001;
  transition: color 0.3s ease;
}
#amoraGalleryModal .close-gallery:hover {
  color: #ff4fad;
}

/* ===================================
   📱 RESPONSIVE
   =================================== */
@media (max-width: 992px) {
  #chatSection .character-list,
  #chatSection .profile-panel {
    display: none !important;
  }
  #chatSection .chat-container {
    flex: 1 1 100%;
  }
}

/* ===============================
   💎 PROFILE INFO BOX STYLING FIX
   =============================== */
#chatSection .profile-body {
  background: rgba(20, 10, 25, 0.7);
  border: 1px solid rgba(255, 0, 150, 0.15);
  border-radius: 12px;
  padding: 16px;
  margin-top: 12px;
  box-shadow: 0 0 25px rgba(255, 0, 150, 0.08);
  color: #e8c4d8;
  text-align: center;
}

#chatSection .profile-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: #ffb8dc;
}

#chatSection .profile-stats span {
  display: flex;
  align-items: center;
  gap: 6px;
}

#chatSection .profile-body p {
  margin: 8px 0;
  line-height: 1.45;
  font-size: 0.95rem;
  color: #e8c4d8;
}

#chatSection .profile-tags {
  margin-top: 8px;
  margin-bottom: 10px;
}

#chatSection .profile-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

#chatSection .profile-actions .btn {
  flex: 1;
  border-radius: 25px;
  padding: 8px 0;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.25s;
}

#chatSection .profile-actions .btn.primary {
  background: linear-gradient(90deg, #ff007f, #c83df7);
  color: #fff;
}

#chatSection .profile-actions .btn.secondary {
  background: rgba(255, 0, 130, 0.12);
  color: #ffb8dc;
  border: 1px solid rgba(255, 0, 130, 0.3);
}

#chatSection .profile-actions .btn.tertiary {
  background: rgba(255, 255, 255, 0.05);
  color: #ccc;
}

#chatSection .profile-tags .tag {
  background: rgba(255, 0, 130, 0.1);
  border: 1px solid rgba(255, 0, 130, 0.2);
  color: #ffb8dc;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 20px;
}

#chatSection .profile-tags .tag:empty::before {
  content: "No Tags";
  opacity: 0.6;
  font-style: italic;
}

/* ===================================
   📱 MOBILE PROFILE MODAL
   =================================== */
.mobile-profile-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 0, 20, 0.88);
  backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999999;
}

.mobile-profile-modal.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.mobile-profile-content {
  background: linear-gradient(180deg, rgba(35, 15, 45, 0.95), rgba(15, 5, 25, 0.95));
  border: 1px solid rgba(255, 0, 150, 0.25);
  border-radius: 18px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
  padding: 20px 16px 30px;
  color: #ffb8dc;
  box-shadow: 0 0 30px rgba(255, 0, 130, 0.25);
}

.close-mobile-profile {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}

.mobile-profile-avatar {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid rgba(255, 0, 120, 0.25);
  margin-bottom: 15px;
}

.mobile-profile-name {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #ffb8dc;
}

.mobile-profile-stats {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-bottom: 10px;
  background: rgba(25, 10, 30, 0.85);
  border: 1px solid rgba(255, 0, 130, 0.15);
  border-radius: 10px;
  padding: 6px;
}

.mobile-profile-stats span {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9rem;
}

.mobile-profile-about {
  font-size: 0.9rem;
  color: #e8c4d8;
  margin: 12px 0 16px;
  line-height: 1.5;
}

.mobile-gallery-wrapper {
  margin-bottom: 16px;
}

.mobile-profile-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 15px;
}

.mobile-profile-actions .btn {
  flex: 1;
  border-radius: 25px;
  padding: 10px 0;
  font-weight: 600;
}

/* ===================================
   📱 MOBILE PROFILE MODAL (SLIDE-UP STYLE)
   =================================== */
.mobile-profile-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 0, 20, 0.88);
  backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: flex-end;
  z-index: 999999;
}

.mobile-profile-modal.active {
  display: flex;
  animation: fadeIn 0.3s ease forwards;
}

.mobile-profile-content {
  background: linear-gradient(180deg, rgba(35, 15, 45, 0.96), rgba(15, 5, 25, 0.96));
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  text-align: center;
  padding: 24px 18px 40px;
  color: #ffb8dc;
  box-shadow: 0 -6px 25px rgba(255, 0, 130, 0.3);
  transform: translateY(100%);
  animation: slideUp 0.35s ease forwards;
}

/* Close button */
.close-mobile-profile {
  position: absolute;
  top: 10px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  z-index: 999999;
  transition: color 0.2s ease;
}
.close-mobile-profile:hover { color: #ff4fad; }

/* Keyframes */
@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ===================================
   📱 MOBILE CHAT FIXES
   =================================== */
@media (max-width: 992px) {
  #chatSection {
    flex-direction: column;
  }

  #chatSection .character-list {
    display: none !important;
  }

  #chatSection .chat-container {
    flex: 1 1 auto;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: rgba(15, 8, 25, 0.95);
  }

  #chatSection .chat-header {
    display: flex;
    position: sticky;
    top: 0;
    background: rgba(20, 8, 30, 0.98);
    z-index: 10;
  }

  #chatSection .chat-messages {
    flex: 1;
    overflow-y: auto;
  }

  #chatSection .profile-panel {
    display: none !important;
  }

  /* Modal full height fix */
  .mobile-profile-modal.active {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
  }

  .mobile-profile-content {
    width: 100%;
    max-width: none;
    height: 90vh;
    overflow-y: auto;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
  }

  .mobile-profile-avatar {
    width: 100%;
    max-height: 260px;
    object-fit: contain;
    border-radius: 16px;
    border: 1px solid rgba(255, 0, 130, 0.3);
  }
}

/* ===================================
   📱 MOBILE GALLERY GRID FIX
   =================================== */
#mobileProfileGallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

#mobileProfileGallery .gallery-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}

#mobileProfileGallery .gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.3s ease;
}

#mobileProfileGallery .gallery-item img:hover {
  transform: scale(1.05);
}

#mobileProfileGallery .gallery-item.locked::after {
  content: "🔒";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  color: #fff;
}

#mobileProfileGallery .gallery-item.locked img {
  filter: blur(6px) brightness(0.6);
  pointer-events: none;
}

/* =========================================
   💎 UNLOCK PAYMENT POPUP (FIXED CENTERED)
   ========================================= */
.payment-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 0, 20, 0.8);
  backdrop-filter: blur(10px);
  z-index: 999999; /* higher than chat & modals */
  pointer-events: all;
}

.payment-content {
  background: linear-gradient(180deg, #22002f, #3a0048);
  padding: 24px 28px;
  border-radius: 16px;
  box-shadow: 0 0 25px rgba(255, 0, 120, 0.4);
  text-align: center;
  color: #fff;
  width: 90%;
  max-width: 340px;
  transform: translateY(0);
  animation: popupFadeIn 0.25s ease;
}

.payment-content h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
  color: #fff;
}

.payment-content p {
  font-size: 0.95rem;
  opacity: 0.9;
  margin-bottom: 18px;
  line-height: 1.4;
}

.payment-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.payment-buttons button {
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

#unlockNowBtn {
  background: linear-gradient(90deg, #ff33a6, #ff5dcf);
  color: #fff;
  box-shadow: 0 0 8px rgba(255, 0, 150, 0.4);
}

#unlockNowBtn:hover {
  background: linear-gradient(90deg, #ff5dcf, #ff33a6);
  transform: scale(1.05);
}

#maybeLaterBtn {
  background: rgba(255, 255, 255, 0.1);
  color: #ccc;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#maybeLaterBtn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

@keyframes popupFadeIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
/* -------------------------------------------------
   IMAGE BUTTON – BEAUTIFUL & ALIGNED
   ------------------------------------------------- */
.message.bot { position: relative; }
.message-actions {
  display: flex; justify-content: flex-start; align-items: center;
  gap: 8px; margin-top: 6px; padding: 0 4px;
}
.msg-image-btn.icon-only {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,0,102,.15), rgba(255,0,150,.25));
  border: 1.5px solid rgba(255,0,120,.4);
  box-shadow: 0 0 8px rgba(255,0,120,.3), inset 0 1px 2px rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .25s ease;
}
.msg-image-btn.icon-only:hover {
  background: linear-gradient(135deg, rgba(255,0,102,.3), rgba(255,0,150,.45));
  border-color: rgba(255,0,120,.8);
  box-shadow: 0 0 16px rgba(255,0,120,.6), inset 0 1px 3px rgba(255,255,255,.2);
  transform: translateY(-1px) scale(1.05);
}
.msg-image-btn.icon-only svg { width:18px; height:18px; stroke:#ff69b4; }
@media (max-width:768px){
  .msg-image-btn.icon-only{width:32px;height:32px}
  .msg-image-btn.icon-only svg{width:16px;height:16px}
}

/* === Membership Modal Shell === */
.membership-modal {
  position: fixed;
  inset: 0;
  display: none;              /* 🔑 hide by default */
  align-items: center;
  justify-content: center;
  z-index: 9999;
  font-family: inherit;
}

/* When active, show as flex overlay */
.membership-modal.active {
  display: flex;
}

/* Dark backdrop */
.membership-modal-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(255, 0, 102, 0.2), transparent),
              rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

/* Modal content card */
.membership-modal-content {
  position: relative;
  max-width: 960px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  background: rgba(10, 10, 20, 0.96);
  border-radius: 18px;
  padding: 24px 20px 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 0, 102, 0.35);
}

/* Close button */
.membership-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

/* Plans grid */
.membership-plans-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.plan-card {
  background: radial-gradient(circle at top left, rgba(255, 0, 102, 0.18), transparent),
              rgba(15, 15, 25, 0.98);
  border-radius: 16px;
  padding: 14px 14px 16px;
  border: 1px solid rgba(255, 0, 102, 0.25);
}

.plan-price {
  font-weight: 600;
  margin: 4px 0 8px;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.plan-features li {
  margin-bottom: 4px;
}

.plan-cta {
  width: 100%;
  border-radius: 999px;
  padding: 8px 10px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  background: linear-gradient(135deg, #ff007f, #ff4fb5);
  color: #fff;
}

/* Mobile */
@media (max-width: 768px) {
  .membership-plans-grid {
    grid-template-columns: 1fr;
  }
}

.sale-secondary-btn,
#saleLaterBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: #e5e5ff;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  outline: none;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.sale-secondary-btn:hover,
#saleLaterBtn:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  transform: translateY(-1px);
}

/* Hover / focus */
.sale-secondary-btn:hover,
.sale-secondary-btn:focus,
#saleLaterBtn:hover,
#saleLaterBtn:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.7);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

/* Active (click) */
.sale-secondary-btn:active,
#saleLaterBtn:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

/* 💜 Centered Auto Chat Teaser Popup */
#autoChatTeaser {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -40%); /* start slightly above center */
  z-index: 1400;

  width: min(380px, 92vw);
  border-radius: 18px;
  background: radial-gradient(circle at top left, #ff2ea6, #6124ff 45%, #15152a 90%);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.7);

  color: #fff;
  padding: 14px 16px;

  display: none;          /* hidden by default */
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s ease-out,
    transform 0.25s ease-out;
}

/* 👇 JS adds .active – this is the “visible” state */
#autoChatTeaser.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);   /* perfect center */
}

/* Inner layout */
.auto-chat-popup-inner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  position: relative;
}

/* Avatar */
.auto-chat-popup-avatar-wrap {
  flex-shrink: 0;
}

.auto-chat-popup-avatar {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.6);
}

/* Text block */
.auto-chat-popup-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.auto-chat-popup-header {
  font-size: 13px;
  opacity: 0.9;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.auto-chat-popup-name {
  font-weight: 600;
  font-size: 14px;
}

.auto-chat-popup-tagline {
  font-size: 13px;
}

.auto-chat-popup-text {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
  background: rgba(6, 6, 18, 0.6);
  border-radius: 10px;
  padding: 8px 10px;
}

/* Buttons */
.auto-chat-popup-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.auto-chat-popup-btn-primary {
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(90deg, #ff2ea6, #9747ff);
  color: #fff;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.auto-chat-popup-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  opacity: 0.95;
}

.auto-chat-popup-btn-secondary {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, opacity 0.12s ease;
}

.auto-chat-popup-btn-secondary:hover {
  background: rgba(0, 0, 0, 0.2);
  opacity: 0.9;
}

/* Close button */
.auto-chat-popup-close {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: none;
  background: rgba(5, 5, 20, 0.9);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mobile tweak */
@media (max-width: 600px) {
  #autoChatTeaser {
    width: 94vw;
    top: 55%;
    transform: translate(-50%, -45%);
  }

  .auto-chat-popup-inner {
    align-items: flex-start;
  }
}

/* Photo chip under bot messages */
.message .message-image-trigger {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 11px;
  line-height: 1;
  color: #fff;
  cursor: pointer;
  outline: none;
  transition:
    background 0.15s ease,
    transform 0.1s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.message .message-image-trigger .mi-label {
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Minimal “photo frame” icon */
.message .message-image-trigger .mi-icon {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-sizing: border-box;
}

.message .message-image-trigger .mi-icon::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.message .message-image-trigger .mi-icon::after {
  content: "";
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  top: 3px;
  right: 3px;
  background: #ff6bb5; /* tiny “camera light” */
}

/* Hover / active (for desktop) */
@media (hover: hover) {
  .message .message-image-trigger:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.32);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    transform: translateY(-1px);
  }
}

.message .message-image-trigger:active {
  transform: translateY(0);
  box-shadow: none;
  background: rgba(255, 255, 255, 0.08);
}

.membership-note-nsfw {
  margin-top: 6px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.78);
}

.membership-highlight {
  font-weight: 900;
  color: #ff5fd9; /* your pink accent */
}


/* ============================
   Chat Sidebar Character List
   ============================ */

#characterList {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem 0.75rem 1rem;
  overflow-y: auto;
}

/* Small vertical cards only for the chat sidebar */
.chat-character-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 18px;
  background: rgba(8, 5, 15, 0.95);
  padding: 0.35rem 0.35rem 0.55rem;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease;
  border: 1px solid rgba(255, 0, 127, 0.25);
}

.chat-character-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 14px rgba(255, 0, 127, 0.45);
  border-color: rgba(255, 0, 127, 0.7);
}

/* Thumbnail */
.chat-character-media {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
}

.chat-character-media img,
.chat-character-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Name text under thumbnail */
.chat-character-name {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #ffffff;
  text-align: center;
  line-height: 1.2;
}

/* Optional: tighter look on very small screens */
@media (max-width: 900px) {
  #characterList {
    gap: 0.6rem;
    padding: 0.5rem 0.5rem 0.85rem;
  }
  .chat-character-name {
    font-size: 0.78rem;
  }
}
