/* style.css */

/* Font Face */
@font-face {
  font-family: 'YekanBakh';
  src: url('../fonts/YekanBakh-Regular.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Root Variables */
:root {
  --primary-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
  --secondary-gradient: linear-gradient(135deg, #f472b6, #db2777);
  --bg-color: #ffffff;
  --chat-bg: #f8fafc;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --bot-message-bg: #f1f5f9;
  --user-message-bg: #5468b5;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --accent-color: #6366f1;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-color: #0f172a;
  --chat-bg: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --bot-message-bg: #334155;
  --user-message-bg: #6366f1;
  --border-color: #334155;
  --body-bg: #1e293b;
}

/* Global Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'YekanBakh', sans-serif;
  letter-spacing: -.5px;
}

html, body {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: var(--bg-color);
  color: var(--text-primary);
  transition: all 0.3s ease;
}

body {
  background-image: url(/images/mini.svg);
  background-repeat: repeat;
  background-size: contain;
}

/* Admin Body */
html, body.admin-body {
  height: 100%;
  overflow: hidden;
}

/* Container */
.container {
  max-width: 1000px;
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background-color: var(--bg-color);
  box-shadow: 0 0px 2px rgb(201 189 189);
  border-radius: 12px;
  margin-top: 10px;
  user-select: none;
  height: 72px;
  position: relative;
  width: 100%;
  z-index: 1;
}

.admin-container .header {
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-title h1 {
  font-size: 20px;
  font-weight: 500;
}

.bot-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 12px;
  color: var(--text-secondary);
}

.status-indicator {
  width: 8px;
  height: 8px;
  background: #12c4e3;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1.2); opacity: 1; }
  50% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.2); opacity: 1; }
}

.controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Hamburger Menu */
.hamburger-menu {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--text-primary);
  margin-left: 5px;
}

/* Logo */
.logo {
  width: 35px;
  height: 35px;
}

.logo:hover {
  filter: drop-shadow(0px 0px 4px #825ff5);
}

/* Chat Container */
.chat-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 10px 18px 10px;
  background-color: var(--chat-bg);
  scroll-behavior: smooth;
  position: relative;
  margin: 10px 0;
  border-radius: 10px;
  box-shadow: 0 0px 2px rgb(201 189 189);
}

.chat-container::-webkit-scrollbar {
  width: 0;
}

/* Message */
.message {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(20px);
  animation: messageAppear 0.5s ease forwards;
  max-width: 100%;
}

@keyframes messageAppear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.user-message .avatar {
  background: linear-gradient(45deg, #010b5b, #0042b0);
}

.message-content-area {
  max-width: calc(100% - 60px);
  display: flex; /* اضافه شده */
  flex-direction: column; /* اضافه شده */
  gap: 0.5rem;
}

.message-bubble {
  padding: 10px;
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal; /* Changed from pre-wrap to normal to avoid line breaks */
  display: inline-block; /* Changed from grid to inline-block to keep content inline */
}

.bot-message .message-bubble {
  background-color: var(--bot-message-bg);
  margin: 0 7px;
  width: fit-content;
  justify-self: left;
  max-width: calc(100% - 12px);
}

.user-message .message-bubble {
  background: var(--user-message-bg);
  color: white;
  margin: 0 7px;
  width: fit-content;
  justify-self: right;
}

.bot-message {
  flex-direction: row-reverse;
}

.bot-message .message-footer {
  justify-self: left;
  margin-left: 10px;
  margin-right: auto;
}

.user-message .message-footer {
  justify-self: right;
  margin-right: 10px;
}

/* File Preview */
.file-preview-box {
  text-align: center;
  vertical-align: middle;
  max-height: 30px;
  display: flex;
  margin: 0;
}

.file-preview-box.image-file {
  max-height: 100%;
}

.file-preview-box a {
  display: flex;
  gap: 15px;
}

.file-preview-box a img {
  border-radius: 6px;
  margin: 0;
  max-height: 67.5px;
  min-height: 67.5px;
  width: auto;
  min-width: 67.5px;
}

.user-message .message-bubble .file-preview-box a {
  color: #fff;
}

.bot-message .message-bubble .file-preview-box a {
  color: #595959;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  padding: 0;
  background: transparent;
  box-shadow: none;
  margin: 0;
}

.typing-dots {
  display: flex;
  gap: 0.4rem;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background-color: #12c4e3;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.7; }
  40% { transform: scale(1); opacity: 1; }
}

.typing-indicator-wrapper {
  opacity: 0;
  transform: translateY(20px);
  animation: messageAppear 0.5s ease forwards;
}

.message.bot-message.typing-indicator-wrapper .message-bubble {
  background: #002864;
}

/* Input Container */
.input-container {
  position: relative;
  background-color: var(--bg-color);
  box-shadow: 0 0px 2px rgb(201 189 189);
  margin-bottom: 10px;
  border-radius: 12px;
  user-select: none;
  padding: 0.5rem;
}

.input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background-color: var(--bg-color);
  border-radius: 1rem;
}

.message-input-container {
  position: relative;
  flex: 1;
}

.message-input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--chat-bg);
  color: var(--text-primary);
  font-size: 15px;
  resize: none;
  line-height: 1.5;
  min-height: 2.5rem;
  max-height: 12rem;
  overflow-y: hidden;
  scrollbar-width: thin;
  transition: height 0.2s ease;
}

.message-input::-webkit-scrollbar {
  width: 6px;
}

.message-input::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 10px;
}

.message-input.custom-focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 4px 0px #6366f18a;
}

.message-input::placeholder {
  color: var(--text-secondary);
}

.action-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.left-buttons {
  display: flex;
  gap: 0.5rem;
  margin-right: -10px;
}

.left-buttons .voice-button {
    display: none;
}

.attach-button,
.voice-button,
.emoji-button,
.send-button {
  background: none;
  border: none;
  cursor: pointer;
  color: #a2a2a2;
  width: 40px;
  height: 40px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease, transform 0.2s ease;
}

.send-button {
  background: var(--primary-gradient);
  color: white;
}

.send-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.attach-button:hover,
.voice-button:hover,
.emoji-button:hover {
  color: #364ab1;
}

/* Emoji Panel */
.emoji-panel {
  position: fixed;
  background: #e6e6e6;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.5rem;
  z-index: 1001;
  max-height: 120px;
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
  display: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
  user-select: none;
  border-top: 1px solid #ffb02e;
  text-align: center;
}

.emoji-panel::-webkit-scrollbar {
  display: none;
}

div#emojiPanel span {
    border-radius: 50px;
    display: inline-grid;
    width: 30px;
    height: 30px;
    text-align: center;
    padding: 0 !important;
    margin: 0 !important;
}

div#emojiPanel span:hover {
    border-radius: 50px;
    display: inline-grid;
    width: 30px;
    height: 30px;
    text-align: center;
    padding: 0 !important;
    margin: 0 !important;
    background: #6366f1;
}

/* Suggestions */
.suggestions {
  position: absolute;
  bottom: 100%;
  right: 0;
  width: 100%;
  max-height: 200px;
  overflow-y: auto;
  background: var(--chat-bg);
  border: 1px solid #33415500;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  direction: rtl;
  margin-bottom: 5px;
}

#productSuggestions {
  position: absolute;
  background: #c2cad6;
  border-radius: 8px;
  max-height: 210px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
  direction: rtl;
  left: 0;
  right: 0;
  width: 100% !important;
  margin-inline: auto;
}

#productSuggestions::-webkit-scrollbar {
  width: 0;
}

.suggestions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  background: #334155;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1;
}

.suggestions-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: #f8fafc;
}

.suggestions-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #f8fafc;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  transition: color 0.2s ease;
}

.suggestions-close-btn:hover {
  color: #f9c23c;
}

.suggestion-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #1e293b;
  border-bottom: 1px solid var(--border-color);
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 0 0px 1px #fff;
}

.product-selected-message {
  display: none;
  align-items: center;
  justify-content: space-between;
  background-color: #e6f3ff;
  font-size: 0.9rem;
  color: #333;
  position: relative;
  bottom: -7px;
  left: 0;
  right: 0;
  margin-bottom: 0;
  border-radius: 12px 12px 0 0;
  padding: 8px 10px 14px;
  border: 1px solid var(--border-color);
}

.suggest-product-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: #007bff;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 50px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.suggest-product-btn:hover {
  background-color: #0056b3;
}

.suggest-product-btn i {
  font-size: 0.75rem;
}

/* AJAX Loading */
.input-wrapper.loading::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--text-secondary);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
}

@keyframes spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

/* Admin Panel */
.admin-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-main {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.admin-sidebar {
  background-color: var(--bg-color);
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  padding: 1rem;
  flex-shrink: 0;
}

.admin-sidebar h2 {
  margin-bottom: 0;
  font-size: 1rem;
}

.search-wrapper {
  position: relative;
  margin-bottom: 1rem;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

.search-input {
  width: 100%;
  padding: 0.6rem 0.6rem 0.6rem 1.8rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text-primary);
  background-color: var(--chat-bg);
}

.search-input::placeholder {
  color: var(--text-secondary);
}

.user-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.user-list button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  text-align: left;
  padding: 10px;
  background-color: var(--bot-message-bg);
  color: var(--text-primary);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  position: relative;
  min-height: 80px;
}

.user-list button:hover {
  background-color: #dce3ec;
  transform: translateY(-2px);
}

.user-list button span.user-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.user-list button span.last-msg {
  color: var(--text-primary);
  font-size: 0.85rem;
  max-width: 50%;
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.user-list button span.last-time {
  font-size: 0.75rem;
  color: var(--text-primary);
  position: absolute;
  bottom: 10px;
  left: 10px;
}

.message-bubble.faq-bubble {
    max-height: 500px;
    overflow: auto;
    display: block;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) var(--bot-message-bg);
    margin-right: auto;
}

.admin-chatview {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  overflow: hidden;
}

.admin-chatview h2 {
  margin-bottom: 1rem;
  font-size: 1rem;
}

.admin-conversation {
  background-color: var(--chat-bg);
  flex: 1;
  border-radius: 8px;
  padding: 1rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.no-selection {
  color: var(--text-secondary);
}

.admin-bottom-bar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-shrink: 0;
}

.admin-action-bar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.admin-btn {
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  padding: 10px 15px;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.3s, transform 0.2s;
}

.admin-btn:hover {
  opacity: 0.9;
  transform: scale(1.03);
}

.takeover-btn {
  background: linear-gradient(135deg, #ec4899, #db2777);
  width: 150px;
}

.continue-btn {
  background: linear-gradient(135deg, #ca8a04, #f59e0b);
  width: 150px;
}

.refresh-btn {
  margin-left: auto;
  background: linear-gradient(135deg, #9333ea, #a855f7);
  width: 42px;
  height: 42px;
  justify-content: center;
}

.admin-input[disabled],
.admin-input .message-input[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Bookmark Panel */
.bookmark-panel {
  background: var(--chat-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem;
  margin: 0.5rem 0;
  max-height: 250px;
  overflow-y: auto;
}

.bookmark-item {
  display: block;
  width: 100%;
  text-align: right;
  padding: 8px;
  margin-bottom: 4px;
  background: #e2e8f0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.bookmark-item:hover {
  background: #cbd5e1;
}

/* Theme Toggle */
button.theme-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
}

.fa-moon:before {
  font-size: 20px;
  color: #5b5da4;
  top: 3px;
  position: relative;
}

.fa-sun:before {
  color: #f9d376;
  font-size: 20px;
  top: 3px;
  position: relative;
}

/* Audio Player */
.custom-audio-player {
  direction: rtl;
  display: inline-flex;
  align-items: center;
  margin: 5px 0;
}

.player-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #272727;
  border-radius: 9999px;
  padding: 6px 6px;
  gap: 10px;
  min-width: 120px;
}

.player-time-box,
.time-info {
  display: flex;
  align-items: center;
}

.player-time,
.total-time,
.current-time {
  font-size: 14px;
  width: 40px;
  text-align: left;
  color: #ffffff;
}

.player-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border: 2px solid #ccc;
  border-radius: 50%;
}

.btn-play {
  border-color: #002864;
}

.playing-btn {
  border-color: #EF5533;
}

.paused-btn {
  border-color: #002864;
}

.icon-play {
  position: relative;
  width: 14px;
  height: 14px;
}

.icon-play::before {
  content: "\f04b";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: #002864;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.icon-stop {
  position: relative;
  width: 14px;
  height: 14px;
}

.icon-stop::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background: #EF5533;
  border-radius: 4px;
}

.wave-bars {
  display: flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  user-select: none;
  direction: ltr;
}

.bar {
  width: 3px;
  height: 16px;
  background: #c4bcca;
  border-radius: 2px;
  transform-origin: bottom;
  transition: background 0.05s linear;
}

.bar.animating {
  animation: waveAnimate 1.2s infinite ease-in-out;
}

.bar:nth-child(1).animating { animation-delay: 0.0s; }
.bar:nth-child(2).animating { animation-delay: 0.1s; }
.bar:nth-child(3).animating { animation-delay: 0.2s; }
.bar:nth-child(4).animating { animation-delay: 0.3s; }
.bar:nth-child(5).animating { animation-delay: 0.4s; }
.bar:nth-child(6).animating { animation-delay: 0.2s; }
.bar:nth-child(7).animating { animation-delay: 0.1s; }
.bar:nth-child(8).animating { animation-delay: 0.3s; }
.bar:nth-child(9).animating { animation-delay: 0.4s; }
.bar:nth-child(10).animating { animation-delay: 0.2s; }

@keyframes waveAnimate {
  0% { transform: scaleY(0.3); }
  20% { transform: scaleY(1); }
  40% { transform: scaleY(0.5); }
  60% { transform: scaleY(1); }
  80% { transform: scaleY(0.8); }
  100% { transform: scaleY(0.3); }
}

/* Icons */
.bot-avatar-icon {
  width: 12px !important;
  height: 12px !important;
  position: fixed;
  left: 15px !important;
  top: 35px !important;
  border-radius: 0 !important;
}

.fa-user-shield:before {
  content: "\f505";
  color: #d82929;
  font-size: 12px;
  position: fixed;
}

#btnContinueBot .fa-robot:before,
#btnTakeOver .fa-user-shield:before {
  position: relative;
  left: 4px;
  color: #ffffff;
}

.fa-file:before,
.fa-file-audio:before {
  font-size: 20px;
  vertical-align: top;
}

.fa-user:before {
  content: "\f007";
  font-size: 15px;
  position: relative;
  bottom: 4px;
}

.fa-mail-reply:before,
.fa-reply:before {
  color: #6366f1;
}

/* Slider */
.slider-track {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
  padding: 0;
  margin: 0;
}

.slider-track::-webkit-scrollbar {
  display: none;
}

.message-bubble .chat-image:not(.slider-track .chat-image) {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: contain;
  border-radius: 12px;
  margin-right: 0;
  margin-left: 0;
  cursor: pointer;
}

.slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, transform 0.3s ease;
  z-index: 2;
}

.slider-nav:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translateY(-50%) scale(1.1);
}

.slider-nav.next {
  left: 10px;
}

.slider-nav.prev {
  right: 10px;
}

.slider-nav.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(0, 0, 0, 0.3);
  transform: translateY(-50%) scale(1);
}

/* Image Popup */
.image-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-popup.show {
  opacity: 1;
  visibility: visible;
}

.popup-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
}

.popup-content {
  position: relative;
  max-width: 90%;
  max-height: 90vh;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.popup-content img {
  max-width: 100%;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  max-height: 100%;
  object-fit: contain;
  margin: auto;
}

.popup-close {
  position: absolute;
  top: 5px;
  left: 5px;
  padding: 0px 1px 1px 0px;
  background: #933c3c;
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  transition: background 0.3s ease;
}

.popup-close:hover {
  background: #e60000;
}

.popup-slider-track {
  display: flex;
  overflow-x: hidden;
  scroll-snap-type: x mandatory;
  width: 100%;
  max-width: -webkit-fill-available;
  height: auto;
  cursor: grab;
}

.popup-image {
  width: 100%;
  border-radius: 10px;
  scroll-snap-align: center;
  margin-inline: 0;
}

.popup-image:not(:first-of-type):not(:last-of-type) {
  margin-inline: 10px;
}

.popup-slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, transform 0.3s ease;
  z-index: 2;
}

.popup-slider-nav:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translateY(-50%) scale(1.1);
}

.popup-slider-nav.next {
  left: 10px;
}

.popup-slider-nav.prev {
  right: 10px;
}

.popup-slider-nav.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(0, 0, 0, 0.3);
  transform: translateY(-50%) scale(1);
}

/* Reply Popup */
#userReplyPopup {
  background: var(--chat-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem;
  margin: 0.5rem 0;
  display: none;
  position: relative;
}

#userReplyPopupContent {
  color: #1e293b;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

#cancelUserReplyBtn {
  background: #1e293b;
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  position: relative;
  display: inline-flex;
  float: left;
}

#cancelUserReplyBtn:hover {
  background: #e60000;
}

div#userReplyInner {
  position: relative;
  bottom: -8px !important;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 0;
  background: #e6e6e6;
  padding: 10px 16px 16px;
  border-radius: 10px 10px 0 0;
  margin-bottom: 0;
  border-top: 1px solid #ffb02e;
  height: 52px;
}

/* FAQ Panel */
.faq-button {
  background: none;
  border: none;
  cursor: pointer;
  color: #a2a2a2;
  width: 40px;
  height: 40px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease, transform 0.2s ease;
}

.faq-button:hover {
  color: #364ab1;
}

.faq-panel {
  display: none;
}

.faq-panel.active {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--chat-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 0;
  z-index: 1001;
  max-height: 500px !important;
  width: 90%;
  max-width: 500px;
  box-shadow: var(--shadow-md);
  overflow: auto !important;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.faq-panel::-webkit-scrollbar {
  display: none;
}

.faq-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.6rem;
  background: #d5d3d3;
  color: #002864;
  position: sticky;
  top: 0;
  z-index: 1;
}

div#faqPanel .faq-content {
    margin: 0.5rem;
}

.faq-title {
  font-size: 1rem;
  font-weight: 600;
}

.faq-close-btn {
  background: none;
  border: none;
  color: #002864;
  font-size: 1rem;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.faq-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.faq-content {
  background: transparent !important;
  border-radius: 12px;
  padding: 0 !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.faq-item {
  margin-bottom: 1rem;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.faq-question {
  background: var(--bot-message-bg);
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s ease;
}

.faq-question:hover {
  background: #e2e8f0;
}

[data-theme="dark"] .faq-question {
  background: #334155;
}

[data-theme="dark"] .faq-question:hover {
  background: #475569;
}

.faq-question::after {
  content: '\f078'; /* FontAwesome chevron-down */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.8rem;
  transition: transform 0.3s ease;
}

.faq-item.active .faq-question::after {
  transform: rotate(180deg);
}

.faq-question-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: space-between; /* Ensure text and icon are on opposite sides */
  gap: 20px;
  background: #eee !important;
}

.faq-question-btn:hover {
  transform: translateX(0px); /* Adjusted for right-to-left movement */
  box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.1); /* Shadow on the left */
  border: 1px solid #3f51b5;
}

.faq-question-btn:hover i {
  color: var(--accent-color);
  transform: translateX(5px); /* Move icon to the left on hover */
}

.faq-question-btn:hover .faq-btn-bg {
  opacity: 0.1 !important;
}

/* Remove old dropdown styles */
.faq-answer {
  display: none; /* No longer needed */
}

.faq-item.active .faq-answer {
  display: none; /* No longer needed */
}

.faq-question::after {
  content: ''; /* Remove chevron icon */
}

.faq-item.active .faq-question::after {
  transform: none; /* Remove rotation */
}

.message-bubble.faq-bubble .faq-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #002864 !important;
  position: static;
  top: auto;
  z-index: auto;
  border-radius: 12px;
  justify-content: center;
  text-wrap-mode: nowrap;
}

.faq-button .fas.fa-question-circle {
  color: var(--text-primary) !important; /* Override the default color */
}

i.fas.fa-question-circle::before {
    color: #002864;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .faq-panel {
    border-radius: 16px;
    bottom: auto;
    left: 50%;
    right: auto;
    width: 90%;
    max-width: none;
    transform: translate(-50%, -50%);
  }
  
  .faq-panel.active {
    max-height: 300px !important;
  }
}

.reply-quote {
  display: flex;
  max-height: 30px;
  margin: 0;
  overflow-wrap: break-word;
  font-weight: 300;
}

/* Price Table */
.price-heading {
  font-weight: 500;
  margin-bottom: 0.6rem;
}

.price-table-wrapper {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  margin: 0;
  padding: 0;
  box-shadow: none;
}

.price-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  background: #fff;
  margin: 0;
  margin-top: 15px;
  padding: 0;
  color: #1e293b;
  border-radius: 12px;
  overflow: hidden;
  border-color: transparent;
}

.price-table thead {
  background: #f2f2f2;
}

.price-table th, .price-table td {
  padding: 6px 8px;
  border-bottom: 1px solid transparent;
}

.price-toman {
  font-size: 13px;
}

.see-product-btn-wrapper {
  margin: 0;
  display: block;
  width: 100%;
}

.see-product-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: normal;
  width: 100%;
  min-height: 40px;
  max-height: 40px;
  padding: 0 16px;
  background: linear-gradient(45deg, #002864, #12c4e3);
  color: #fff;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s ease;
  margin-top: 15px;
  border: none;
}

.see-product-btn:hover {
  background: linear-gradient(225deg, #002864, #12c4e3);
}

/* Similar Products */
.similar-products-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.similar-product-btn {
  background: #e6e6e6;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #333;
  transition: background 0.2s ease;
}

.similar-product-btn:hover {
  background: #d4d4d4;
}

/* Login Form */
.login-form, .login-container {
  width: 100%;
  max-width: 400px;
  margin: 2rem auto;
  background: var(--chat-bg);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.error-msg {
  background: #ffefef;
  border: 1px solid #ffc0c0;
  color: #c00;
  padding: 0.7rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  text-align: center;
}

/* Dark Theme Overrides */
[data-theme="dark"] .price-table {
  background: #2d3748;
  color: #e2e8f0;
}

[data-theme="dark"] .price-table thead {
  background: #4a5568;
}

[data-theme="dark"] .see-product-btn {
  background: linear-gradient(45deg, #4a90e2, #63b3ed);
}

[data-theme="dark"] .see-product-btn:hover {
  background: linear-gradient(225deg, #4a90e2, #63b3ed);
}

[data-theme="dark"] .similar-product-btn {
  background: #4a5568;
  color: #e2e8f0;
}

[data-theme="dark"] .similar-product-btn:hover {
  background: #718096;
}

[data-theme="dark"] .player-box {
  background: #4a5568;
}

[data-theme="dark"] .bar {
  background: #a0aec0;
}

[data-theme="dark"] .bar.animating {
  background: #63b3ed;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .chat-image:hover {
    transform: none;
  }
  .slider-nav:hover {
    transform: translateY(-50%);
  }
  .message {
    animation: none;
  }
  .typing-indicator {
    margin-bottom: 1rem;
  }
  .typing-indicator-wrapper {
    margin-bottom: 1rem;
  }
  .typing-dot {
    animation: none;
  }
  .bar.animating {
    animation: none;
  }
}

/* Focus and Selection */
input:focus, textarea:focus,
:focus-visible, :focus {
  outline: none;
  box-shadow: none;
}

::selection {
  background: #12c4e3;
  color: #000;
}

/* Toast */
.assistant-toast {
  position: fixed;
  top: 45px !important;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 300px;
  padding: 12px 16px;
  z-index: 1100;
  background: #334155;
  color: #fff;
  font-size: 0.9rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.assistant-toast .progress {
  height: 4px;
  width: 100%;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  overflow: hidden;
}

.assistant-toast .progress-bar {
  height: 100%;
  width: 0%;
  background: #8b5cf6;
  transition: width 5s linear;
}

/* Tooltip */
.custom-tooltip {
  position: absolute;
  background: var(--primary-gradient);
  color: #ffffff;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  z-index: 1002;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out, visibility 0.1s ease-in-out;
  visibility: hidden;
  pointer-events: none;
}

.custom-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

[data-theme="dark"] .custom-tooltip {
  background: linear-gradient(135deg, #4a90e2, #63b3ed);
}

.left-buttons .custom-tooltip {
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
}

.custom-tooltip.visible {
  transform: translateX(-50%) translateY(0);
}

.custom-tooltip::-webkit-scrollbar {
  display: none;
}

.custom-tooltip {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.left-buttons button,
.assistant-toggle {
  position: relative;
}

/* Assistant Toggle */
.assistant-toggle {
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  background-image: url('/images/bot-assistant-enable.svg');
  background-size: 16px 16px;
  background-position: center;
  background-repeat: no-repeat;
}

.assistant-toggle img {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.assistant-toggle.disabled {
  background-image: url('/images/bot-assistant-disable.svg');
  filter: grayscale(1) brightness(0.7);
}

.assistant-toggle.locked {
  background-image: url('/images/bot-assistant-disable.svg') !important;
  pointer-events: none;
}

[data-theme="dark"] .assistant-toggle {
  background-image: url('/images/bot-assistant-enable-dark.svg');
}

[data-theme="dark"] .assistant-toggle.disabled {
  background-image: url('/images/bot-assistant-disable.svg');
  filter: grayscale(1) brightness(0.7);
}

[data-theme="dark"] .assistant-toggle.locked {
  background-image: url('/images/bot-assistant-disable.svg') !important;
}

.assistant-toggle.inactive {
  background-image: url('/images/bot-assistant-disable.svg');
}

[data-theme="dark"] .assistant-toggle.inactive {
  background-image: url('/images/bot-assistant-disable.svg');
}

/* Scrollable Chat */
.chat-scrollable {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  padding: 10px !important;
}

.chat-scrollable::-webkit-scrollbar {
  width: 8px;
  background: transparent;
}

.chat-scrollable::-webkit-scrollbar-track {
  background: var(--chat-bg);
  border-radius: 12px;
  margin: 10px;
}

.chat-scrollable::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 12px;
  border: 2px solid var(--chat-bg);
}

.chat-scrollable::-webkit-scrollbar-thumb:hover {
  background: #7e88ff;
}

.chat-scrollable {
  scrollbar-width: thin;
  scrollbar-color: var(--accent-color) var(--chat-bg);
}

/* Mobile User List */
.mobile-user-list-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 9999;
}

.mobile-user-list-container {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
  background-color: #ffffff;
  padding: 1rem;
  overflow-y: auto;
}

.close-mobile-user-list {
  background: transparent;
  border: none;
  font-size: 20px;
  color: #333;
  margin-bottom: 1rem;
  cursor: pointer;
  float: left;
}

.mobile-user-list-container h2 {
  font-size: 20px;
  font-weight: 500;
}

.faq-bubble {
  background: var(--bot-message-bg);
  padding: 1rem;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  max-width: 90%;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  body {
    overflow: auto;
    background: var(--body-bg);
    -webkit-tap-highlight-color: transparent;
  }

  html, body {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    position: relative;
  }

  html::-webkit-scrollbar,
  body::-webkit-scrollbar {
    width: 0;
    display: none;
  }

  html {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .container {
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  
  .chat-scrollable {
    scrollbar-width: none !important;
    background-image: url(/images/mini.svg);
    background-repeat: repeat;
    background-size: contain;
    padding: 0.5rem !important;
  }

  .hamburger-menu {
    display: inline-flex;
  }

  .voice-button {
    display: flex;
  }

  .header {
    box-shadow: none !important;
    border-radius: 0;
    margin-top: 0;
    height: 56px;
    position: fixed;
    z-index: 1;
    width: 100%;
    top: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
  }

  .header-title h1 {
    font-size: 16px;
  }

  .logo {
    width: 30px;
    height: 30px;
  }

  .chat-container {
    flex: none;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    background: var(--chat-bg);
    border-radius: 0;
    box-shadow: none;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    margin-top: 56px;
    margin-bottom: 60px;
    height: calc(100vh - (56px + 60px));
    inset: auto;
  }

  .chat-container::-webkit-scrollbar {
    display: none;
  }

  .chat-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
  }

  .input-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    background-color: var(--bg-color);
    padding: 0.5rem;
    box-shadow: none !important;
    margin-bottom: 0;
    border-radius: 0;
    right: 0;
  }

  .message-input {
    border-radius: 8px;
    margin: 0;
  }

  .action-buttons {
    justify-content: space-between;
  }

  .attach-button,
  .voice-button,
  .emoji-button,
  .faq-button,
  .send-button {
    width: 36px;
    height: 36px;
  }

  .emoji-panel {
    position: fixed;
    border-radius: 0;
    margin-bottom: 0;
    max-height: 122px;
    width: 100%;
    box-sizing: border-box;
    z-index: 1001;
    border: none;
    border-top: 1px solid #ffb02e;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  [data-theme="dark"] .emoji-panel {
    box-shadow: 0px 3px 0px 0px rgb(30 41 59 / 0%);
  }

  .attach-button, .voice-button, .emoji-button {
    margin-left: 5px;
  }

  #productSuggestions {
    top: auto;
    z-index: 998;
    width: 100% !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
  }

  .suggestions {
    margin-bottom: 0;
  }
  
  .product-selected-message {
    position: relative;
    bottom: -7px;
    left: 0;
    right: 0;
    margin-bottom: 0;
    border-radius: 8px 8px 0 0;
    z-index: 998;
    padding: 10px 10px 16px;
  }

  .suggest-product-btn {
    padding: 5px 10px;
  }

  .slider-nav,
  .popup-slider-nav {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .slider-nav i,
  .popup-slider-nav i {
    font-size: 14px;
  }

  .see-product-btn {
    line-height: 0.7;
  }

  div#userReplyInner {
    position: fixed;
    bottom: calc(-2px + var(--input-container-height, 0px)) !important;
    left: 0;
    right: 0;
    z-index: 999;
    background: #e6e6e6;
    padding: 0.5rem;
    border-radius: 0;
    height: auto;
  }
  
  #userReplyPopupContent p {
    right: 30px;
  }

  .admin-sidebar {
    display: none;
  }

  .chat-container, .admin-conversation {
    padding-bottom: 120px;
  }

  .admin-conversation {
    padding: 0;
  }

  .admin-bottom-bar {
    margin-top: 6.5rem;
    padding: 4px;
  }

  .admin-action-bar {
    position: absolute;
    bottom: 78px;
    justify-self: center;
  }

  .bookmark-panel {
    bottom: 120px;
    position: absolute;
    left: 0;
    right: 0;
  }

  .assistant-toast {
    top: 100px !important;
  }

  .left-buttons .custom-tooltip {
    display: none;
  }
  
  .left-buttons .voice-button {
    display: flex !important;
  }

  .assistant-toggle {
    width: 35px;
    height: 35px;
  }

  .fa-magnifying-glass:before, .fa-search:before {
    content: "\f002";
    position: relative;
    top: 7px;
  }

  .admin-chatview .input-wrapper {
    border-radius: 0;
  }

  #userMessageInput::-webkit-scrollbar {
    width: 0;
    display: none;
  }

  #userMessageInput {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
}

span.msg-status {
    display: none;
}

#userReplyPopupContent p {
    top: 11px;
    position: absolute;
    right: 38px;
}

@media (max-width: 768px) {
    #userReplyPopupContent p {
         right: 30px;
    }
}

/* Animation for typing and deleting text in placeholder */
@keyframes typingCursor {
  0% { opacity: 1; }
  50% { opacity: 0; }
  100% { opacity: 1; }
}

.message-input.typing::after {
  content: '|';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  animation: typingCursor 0.7s infinite;
}

.message-input.deleting::after {
  content: '|';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  animation: typingCursor 0.7s infinite;
}

.message-input {
  position: relative;
  transition: all 0.3s ease;
}

/* Ensure placeholder text aligns correctly during animation */
.message-input::placeholder {
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.feedback-buttons {
  display: flex;
  gap: 8px;
  margin-right: auto;
}

.feedback-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  color: #787878;
  transition: color 0.2s ease, transform 0.2s ease;
}

.feedback-btn:hover {
  transform: scale(1.1);
}

.like-btn:hover {
  color: #28a745; /* سبز برای لایک */
}

.like-btn.liked {
  color: #dc3545 !important; /* قرمز برای لایک پس از کلیک */
}

.like-btn.liked:hover {
  color: #dc3545 !important; /* حفظ رنگ قرمز هنگام هاور */
}

.dislike-btn:hover {
  color: #dc3545; /* قرمز برای دیسلایک */
}

.feedback-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  color: #999; /* رنگ کم‌رنگ‌تر برای حالت غیرفعال */
}

.feedback-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.feedback-btn.disabled:hover {
  transform: none;
  color: #999; /* حفظ رنگ کم‌رنگ هنگام هاور */
}

.reaction-container {
  position: fixed; /* تغییر به fixed */
  z-index: 1000; /* بالاتر از overlay */
}

.reaction-container .wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.reaction-container #container {
  width: 100px; /* اندازه کوچکتر برای دقت بیشتر */
  height: 100px;
  background: transparent;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reaction-container #svgContainer {
  width: 48px;
  height: 100%;
  position: relative;
}

.reaction-container #svgContainer img {
  opacity: inherit;
  filter: brightness(1.5) drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

/* ==========================================================================
   Date Divider
   ========================================================================== */
.date-divider {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1.5rem 0;
  position: relative;
  text-align: center;
}

.date-divider::before,
.date-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
  margin: 0 1rem;
}

.date-divider span {
  background: var(--chat-bg);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.date-divider span:hover {
  background: var(--accent-color);
  color: #fff;
}

/* Dark Theme Adjustments */
[data-theme="dark"] .date-divider span {
  background: var(--chat-bg);
  color: var(--text-secondary);
}

[data-theme="dark"] .date-divider span:hover {
  background: var(--accent-color);
  color: #fff;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .date-divider {
    margin: 1rem 0;
  }

  .date-divider span {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
  }
}

/* حالت انتخاب پیام */
.message-bubble.selected-message {
  background-color: #e0f7fa !important; /* رنگ پس‌زمینه برای حالت انتخاب */
  box-shadow: 0 0 0px 2px #0288d1; /* سایه جدید */
  color: red; /* رنگ متن قرمز */
  transition: background-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

/* نوار عملیات در هدر */
.message-actions {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 12px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.message-actions .action-btn {
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: var(--transition);
}

.message-actions .action-btn:hover {
  opacity: 0.9;
  transform: scale(1.05);
}

.message-actions .copy-btn {
  background: linear-gradient(135deg, #4caf50, #66bb6a);
}

.message-actions .edit-btn {
  background: linear-gradient(135deg, #ff9800, #ffb300);
}

.message-actions .deselect-btn {
  background: linear-gradient(135deg, #ef5350, #f44336);
}

/* جلوگیری از انتخاب متن برای پیام‌های بات */
.bot-message .message-bubble {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* تنظیمات برای موبایل */
@media (max-width: 768px) {
  .message-actions {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    z-index: 2;
    transform: none;
    padding: 0.5rem;
    border-radius: 0;
    background: var(--bg-color);
  }

  .message-actions .action-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }

  /* مخفی کردن المان‌های هدر وقتی message-actions نمایش داده می‌شه */
  .message-actions[style*="display: flex"] ~ .header-title,
  .message-actions[style*="display: flex"] ~ .controls {
    display: none !important;
  }

  .message-actions .deselect-btn {
    margin-right: auto;
  }
}

/* استایل دکمه لینک برای پیام‌های کاربر */
.user-message .message-bubble a.link-button,
.bot-message .message-bubble a.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: linear-gradient(135deg, #4a90e2, #63b3ed);
  color: #fff;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  margin: 0 2px;
  vertical-align: middle;
  line-height: 1;
  height: 24px;
  white-space: nowrap; /* Ensure the button text doesn't wrap */
}

.user-message .message-bubble a.link-button:hover,
.bot-message .message-bubble a.link-button:hover {
  background: linear-gradient(135deg, #63b3ed, #4a90e2);
  transform: translateY(-1px);
}

.user-message .message-bubble a.link-button i,
.bot-message .message-bubble a.link-button i {
  margin-left: 4px;
  font-size: 0.8rem;
}

/* اطمینان از اینکه دکمه‌ها فاصله اضافی عمودی ایجاد نمی‌کنند */
.user-message .message-bubble {
  line-height: 1.5;
  display: inline-block;
}

/* تم دارک */
[data-theme="dark"] .user-message .message-bubble a.link-button,
[data-theme="dark"] .bot-message .message-bubble a.link-button {
  background: linear-gradient(135deg, #60a5fa, #93c5fd);
}

[data-theme="dark"] .user-message .message-bubble a.link-button:hover,
[data-theme="dark"] .bot-message .message-bubble a.link-button:hover {
  background: linear-gradient(135deg, #93c5fd, #60a5fa);
}

.message-text {
  display: inline;
  white-space: normal;
}

/* نوار عملیات در هدر */
.message-actions {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 12px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-color);
  width: 100%;
  height: 72px; /* هم ارتفاع هدر */
  box-sizing: border-box;
  justify-content: space-between; /* برای جابجایی دکمه‌ها */
}

/* استایل دکمه‌های کپی و ویرایش */
.message-actions .copy-btn,
.message-actions .edit-btn {
  height: 34px;
  width: 75px;
  justify-content: center;
  display: flex;
  align-items: center;
  border-radius: 20px;
  padding: 0;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

/* استایل دکمه لغو انتخاب */
.message-actions .deselect-btn {
  height: 34px;
  width: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%; /* دایره‌ای کردن دکمه */
  padding: 0;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

/* وسط‌چین کردن آیکون ضربدر */
.message-actions .deselect-btn i.fas.fa-times {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px; /* اندازه مناسب برای آیکون */
  line-height: 1; /* اطمینان از وسط‌چین عمودی */
}

/* تنظیمات برای دسکتاپ */
@media (min-width: 769px) {
  .message-actions {
    display: none; /* فقط در حالت انتخاب نمایش داده می‌شود */
    position: fixed;
    top: 10px;
    left: 0;
    right: 0;
    z-index: 2;
    transform: none;
    padding: 0.5rem;
    border-radius: 0;
    background: var(--bg-color);
    height: 72px; /* هم ارتفاع هدر */
    width: 100%; /* عرض کامل */
    align-items: center;
    justify-content: space-between; /* دکمه‌ها به دو طرف */
    max-width: 1000px;
    margin: auto;
    border-radius: 12px;
  }

  .message-actions .deselect-btn {
    margin-right: auto; /* انتقال به سمت چپ */
  }

  /* مخفی کردن المان‌های هدر وقتی message-actions نمایش داده می‌شود */
  .message-actions[style*="display: flex"] ~ .header-title,
  .message-actions[style*="display: flex"] ~ .controls {
    display: none !important;
  }
}

/* تنظیمات برای موبایل */
@media (max-width: 768px) {
  .message-actions {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px; /* هم ارتفاع هدر در موبایل */
    z-index: 2;
    transform: none;
    padding: 0.5rem;
    border-radius: 0;
    background: var(--bg-color);
    display: none; /* فقط در حالت انتخاب نمایش داده می‌شود */
    align-items: center;
    justify-content: space-between; /* دکمه‌ها به دو طرف */
  }
  
  .message-bubble.faq-bubble {
    max-height: 300px;
  }

  .message-actions .deselect-btn {
    margin-right: auto; /* انتقال به سمت چپ */
  }

  /* مخفی کردن المان‌های هدر وقتی message-actions نمایش داده می‌شود */
  .message-actions[style*="display: flex"] ~ .header-title,
  .message-actions[style*="display: flex"] ~ .controls {
    display: none !important;
  }
}

.action-mode-buttons {
  width: 100%;
  overflow: hidden;
}

.mode-buttons-scroll {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  padding: 0 0 0.5rem 0;
  scrollbar-width: none; /* مخفی کردن اسکرول‌بار در فایرفاکس */
}

.mode-buttons-scroll::-webkit-scrollbar {
  display: none; /* مخفی کردن اسکرول‌بار در کروم و سافاری */
}

.mode-btn {
  flex: 0 0 auto;
  padding: 8px 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f124, #8b5cf62b);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.mode-btn:hover {
    background: #673ab738 !important;
}

[data-theme="dark"] .mode-btn:hover {
    background: #03a9f44d !important;
}

.mode-btn.active:hover {
    background: var(--primary-gradient) !important;
    color: #fff !important;
}

[data-theme="dark"] .mode-btn.active:hover {
    background: linear-gradient(135deg, #4a90e2, #63b3ed) !important;
}

.mode-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.mode-btn.active:hover {
    background: var(--primary-gradient);
    color: #fff;
}

.mode-btn.active {
  background: var(--primary-gradient);
  color: #fff;
}

[data-theme="dark"] .mode-btn.active {
  background: linear-gradient(135deg, #4a90e2, #63b3ed) !important;
}

.mode-btn.active::before {
  opacity: 1;
}

@media (max-width: 768px) {
  .mode-btn {
    border-radius: 8px;
    border: none;
  }
}

/* Modern Contact Card Design */
.contact-card {
  max-width: 400px;
  background: var(--bot-message-bg);
  border-radius: 20px;
  overflow: hidden;
  margin: 10px 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* Contact Header */
.contact-header {
  background: var(--primary-gradient);
  padding: 20px;
  text-align: center;
  color: #fff;
}

.contact-header h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 5px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.contact-header p {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-right: 10px;
}

/* Contact Body */
.contact-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: #673ab70f;
  font-size: 0.95rem;
}

/* Contact Item */
.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 15px;
  background: #fff;
  border-radius: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
}

.contact-item:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background: #f9f9f9;
}

/* Contact Icon */
.contact-icon {
  font-size: 1.1rem;
  color: var(--text-primary);
  transition: transform 0.3s ease, color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.contact-item:hover .contact-icon {
  transform: scale(1.15);
  color: var(--accent-color);
}

/* Specific Icon Colors */
.contact-item[data-type="phone"] .contact-icon {
  color: #2196F3;
}

.contact-item[data-type="whatsapp"] .contact-icon {
  color: #25D366;
  font-size: 1.258rem;
}

.contact-item[data-type="instagram"] .contact-icon {
  color: #E1306C;
  font-size: 1.258rem;
}

.contact-item[data-type="email"] .contact-icon {
  color: #ff9800;
}

.contact-item[data-type="working-hours"] span.contact-icon {
  color: #673AB7;
}

.contact-item[data-type="address"] span.contact-icon {
  color: #ff6d6d;
}

.contact-item[data-type="map"] .contact-icon {
  color: #abc8e8;
}

/* Contact Links */
.contact-item a {
  color: #2196F3;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

.contact-item a:hover {
  color: #ff4081;
}

/* Specific Colors for Different Types */
.contact-item[data-type="phone"] a {
  color: #2196F3;
}

.contact-item[data-type="phone"] a:hover {
  color: #ff4081;
}

.contact-item[data-type="whatsapp"] a {
  color: #25D366;
}

.contact-item[data-type="whatsapp"] a:hover {
  color: #ff4081;
}

.contact-item[data-type="email"] a {
  color: #ff9800;
}

.contact-item[data-type="email"] a:hover {
  color: #ff4081;
}

/* Map Link (بدون هاور) */
.map-link {
  color: #abc8e8;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: none;
}

.map-link:hover {
  color: #abc8e8;
  text-decoration: none;
}

/* Contact Footer */
.contact-footer {
  background: var(--chat-bg);
  padding: 15px;
  text-align: center;
  border-top: 1px solid var(--border-color);
}

.contact-footer p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.contact-item a {
  color: var(--text-primary) !important;
}

.contact-item a:hover {
  color: red !important;
}

.contact-item[data-type="map"] {
    overflow-wrap: break-word;
    cursor: pointer;
    padding: 0;
    background: #ff6d6d !important;
}

.contact-item[data-type="address"] span {
    margin-right: 5px;
}

.contact-item[data-type="working-hours"] .contact-icon {
    position: relative;
}

.contact-item[data-type="address"] .contact-icon {
    position: relative;
}

.contact-item[data-type="map"] a {
    padding: 10px;
    color: #fff !important;
}

[data-theme="dark"] .contact-item a:hover {
  color: #00BCD4 !important;
}

/* Dark Theme Adjustments */
[data-theme="dark"] .contact-card {
  background: var(--bot-message-bg);
}

[data-theme="dark"] .contact-body {
  background: #673ab733;
}

[data-theme="dark"] .contact-item {
  background: #2d3748;
  border-color: #4a5568;
}

[data-theme="dark"] .contact-item:hover {
  background: #3b4a66;
}

[data-theme="dark"] .contact-footer {
  background: #2d3748;
}

[data-theme="dark"] .contact-footer p {
  color: #94a3b8;
}

[data-theme="dark"] .contact-icon {
  color: #94a3b8;
}

[data-theme="dark"] .contact-item[data-type="phone"] .contact-icon {
  color: #4a90e2;
}

[data-theme="dark"] .contact-item[data-type="whatsapp"] .contact-icon {
  color: #25D366;
}

[data-theme="dark"] .contact-item[data-type="instagram"] .contact-icon {
  color: #C13584;
  font-size: 1.258rem;
}

[data-theme="dark"] .contact-item[data-type="email"] .contact-icon {
  color: #ff9800;
}

[data-theme="dark"] .contact-item[data-type="working-hours"] span.contact-icon {
  color: #9575CD;
}

[data-theme="dark"] .contact-item[data-type="address"] span.contact-icon {
  color: #EF5350;
}

[data-theme="dark"] .contact-item[data-type="map"] .contact-icon {
  color: #82B1FF;
}

[data-theme="dark"] .map-link {
  color: #82B1FF;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .contact-card {
    max-width: 100%;
    margin: 5px 0;
  }

  .contact-header {
    padding: 15px;
  }

  .contact-header h2 {
    font-size: 1rem;
  }

  .contact-header p {
    font-size: 0.85rem;
  }

  .contact-body {
    padding: 15px;
    gap: 10px;
    font-size: 0.9rem;
  }

  .contact-item {
    padding: 8px 12px;
  }

  .contact-item a, .map-link {
    font-size: 0.9rem;
  }

  .contact-footer {
    padding: 10px;
  }

  .contact-footer p {
    font-size: 0.85rem;
  }
}

@media (max-width: 473px) {
  .contact-item[data-type="phone"] a {
  font-size: 14px !important;
  }
}

/* Phone Numbers Container */
.phone-numbers {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: right;
}

.phone-numbers a {
  color: #2196F3;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

.phone-numbers a:hover {
  color: #ff4081;
}

[data-theme="dark"] .phone-numbers a {
  color: #4a90e2;
}

[data-theme="dark"] .phone-numbers a:hover {
  color: #00BCD4;
}

/* Mode Badge */
.mode-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.6rem;
  background: var(--primary-gradient);
  color: white;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-right: 7px; /* فاصله از آواتار */
}

.user-message .mode-badge {
  align-self: flex-start; /* هم‌ترازی با پیام کاربر در سمت راست */
}

.bot-message .mode-badge {
  align-self: flex-start; /* هم‌ترازی با پیام ربات در سمت چپ */
}

.mode-badge i {
  font-size: 0.7rem;
  margin-left: 0.2rem;
}

.mode-badge:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Dark Theme Adjustments for Mode Badge */
[data-theme="dark"] .mode-badge {
  background: linear-gradient(135deg, #4a90e2, #63b3ed);
}

/* Responsive Adjustments for Mode Badge */
@media (max-width: 768px) {
  .mode-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    margin-right: 7px;
  }

  .mode-badge i {
    font-size: 0.65rem;
  }
}

/* استایل دکمه سوالات عمومی صوتی */
.mode-btn[data-mode="voice-faqs"] {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px; /* فاصله بین آیکون و متن */
  padding: 8px 12px; /* تنظیم پدینگ برای فضای داخلی دکمه */
  font-size: 0.85rem;
}

/* استایل آیکون داخل دکمه */
.mode-btn .mode-btn-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  order: -1; /* قرار گرفتن آیکون قبل از متن در جهت RTL */
}

.mode-btn.active[data-mode="voice-faqs"] img {
    filter: invert(1);
}

[data-theme="dark"] .mode-btn[data-mode="voice-faqs"] img {
    filter: invert(1);
}

/* استایل آیکون کنار دکمه سوالات عمومی صوتی */
.mode-btn-wrapper.voice-faqs .mode-btn-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  order: -1; /* اطمینان از قرار گرفتن آیکون قبل از دکمه در جهت RTL */
}

/* استایل گروه دکمه‌ها */
.mode-btn-group {
  display: flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, #6366f124, #8b5cf62b);
  border-radius: 12px;
  padding: 4px 8px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

/* آیکون گروه دکمه‌ها */
.mode-btn-group-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  margin-right: 4px;
}

/* کانتینر دکمه‌های داخل گروه */
.mode-btn-container {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

/* استایل دکمه‌های داخل گروه */
.mode-btn-group .mode-btn {
  padding: 6px 12px;
  font-size: 0.85rem;
  background: transparent;
  border: none;
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.mode-btn-group .mode-btn:last-child {
    border: none;
}

.mode-btn-group .mode-btn.active {
  background: var(--primary-gradient);
  color: #fff;
  border-radius: 12px;
}

/* تنظیمات برای تم دارک */
[data-theme="dark"] .mode-btn-group {
  background: linear-gradient(135deg, #6366f124, #8b5cf62b);
  border-color: var(--border-color);
}

[data-theme="dark"] .mode-btn-group .mode-btn.active {
  background: linear-gradient(135deg, #4a90e2, #63b3ed);
}

/* تنظیمات برای موبایل */
@media (max-width: 768px) {
  .mode-btn-wrapper.voice-faqs .mode-btn-icon {
    width: 18px;
    height: 18px;
  }
  
  .mode-btn-group .mode-btn.active {
    border-radius: 8px;
  }
  
  .mode-btn[data-mode="voice-faqs"] {
    padding: 5px 10px;
    gap: 6px;
    font-size: 0.8rem;
  }

  .mode-btn .mode-btn-icon {
    width: 20px;
    height: 20px;
  }

  .mode-btn-group {
    padding: 3px 6px;
    border-radius: 8px;
    border: none;
  }

  .mode-btn-group-icon {
    width: 20px;
    height: 20px;
  }

  .mode-btn-container {
    gap: 4px;
    width: max-content;
  }

  .mode-btn-group .mode-btn {
    padding: 5px 10px;
    font-size: 0.8rem;
  }
}

/* استایل تصویر در چت */
.chat-image {
    flex: 0 0 auto;
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 6px;
    margin-left: 10px;
    transition: transform 0.3s ease;
}

@media (max-width: 768px) {
  .chat-image {
    min-height: 210px;
    min-width: 210px;
  }    
}

.chat-image:hover {
  transform: scale(1.02);
}

/* استایل کانتینر تصویر */
.image-wrapper {
  position: relative;
  display: inline-block;
  margin: 8px 0 0;
}

/* استایل دکمه‌های عملیاتی */
.image-actions {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-wrapper:hover .image-actions {
  opacity: 1;
}

/* استایل دکمه دانلود */
.download-btn {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.download-btn:hover {
  background-color: #45a049;
  transform: translateY(-2px);
}

.download-btn:active {
  transform: translateY(0);
}

.download-btn i {
  font-size: 16px;
}

[data-theme="dark"] .mode-btn-group-icon[src="/images/chatgptlogo.svg"] {
  filter: invert(1);
}

/* استایل‌های انیمیشن لودینگ جدید */
.waitContent {
  width: 300px;
  height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

@media (max-width: 768px) {
  .waitContent {
    height: 210px;
    width: 210px;
  }    
}

.ball {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.5;
  animation: round 4s cubic-bezier(0.6, 0, 0.4, 1) infinite;
}

.ball:nth-child(1) {
  background-color: #eb2020;
  animation-delay: 0s;
}

.ball:nth-child(2) {
  background-color: #f57d21;
  animation-delay: -0.5s;
}

.ball:nth-child(3) {
  background-color: #eaf42e;
  animation-delay: -1s;
}

.ball:nth-child(4) {
  background-color: #3dd854;
  animation-delay: -1.5s;
}

.ball:nth-child(5) {
  background-color: #3dd89d;
  animation-delay: -2s;
}

.ball:nth-child(6) {
  background-color: #24a2d0;
  animation-delay: -2.5s;
}

.ball:nth-child(7) {
  background-color: #8454ec;
  animation-delay: -3s;
}

.ball:nth-child(8) {
  background-color: #e55aa4;
  animation-delay: -3.5s;
}

@keyframes round {
  0% { 
    transform: translate(-50%, -50%) translate(40px, 0); 
  }
  12.5% { 
    transform: translate(-50%, -50%) translate(30px, 30px); 
  }
  25% { 
    transform: translate(-50%, -50%) translate(0, 40px); 
  }
  37.5% { 
    transform: translate(-50%, -50%) translate(-30px, 30px); 
  }
  50% { 
    transform: translate(-50%, -50%) translate(-40px, 0); 
  }
  62.5% { 
    transform: translate(-50%, -50%) translate(-30px, -30px); 
  }
  75% { 
    transform: translate(-50%, -50%) translate(0, -40px); 
  }
  87.5% { 
    transform: translate(-50%, -50%) translate(30px, -30px); 
  }
  100% { 
    transform: translate(-50%, -50%) translate(40px, 0); 
  }
}

.image-wrapper {
  position: relative;
  display: inline-block;
  margin: 8px 0 0;
}

.download-btn-modern {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(45deg, #570066, #001480);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  width: 100%;
  margin-top: 5px;
}

.download-btn-modern:active {
  transform: translateY(5px);
}

.download-btn-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}

/* استایل فرم لاگین */
.login-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
}

.login-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--chat-bg);
  padding: 20px;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  z-index: 1001;
  width: 90%;
  max-width: 400px;
  text-align: center;
}

.login-modal h3 {
  margin-bottom: 20px;
  color: var(--text-primary);
}

.login-modal input {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text-primary);
}

.login-modal button {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: var(--primary-gradient);
  color: white;
  cursor: pointer;
}

.login-modal .login-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
}

.login-modal #resendLink {
  display: block;
  margin-top: 10px;
  color: var(--accent-color);
}

/* استایل کارت سفارش‌ها */
.orders-card {
  max-width: 400px;
  margin: 10px 0;
  padding: 15px;
  border-radius: 12px;
  background: var(--bot-message-bg);
  box-shadow: var(--shadow-sm);
}

.orders-card h3 {
  margin-bottom: 15px;
  color: var(--text-primary);
}

.orders-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-item {
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.order-item p {
  margin: 5px 0;
}

/* استایل فرم مدرن */
.modern-form {
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease-in-out;
}

.modern-form h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
    text-align: center;
}

.modern-form input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: none;
    border-radius: 8px;
    background: #fff;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.modern-form button {
    width: 100%;
    padding: 10px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.modern-form button:hover {
    background: #357abd;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* استایل قفل سیستم */
.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.tooltip-error {
    position: absolute;
    background: #ff4d4f;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    z-index: 1002;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    top: 100%;
    left: 0;
    margin-top: 5px;
}

.tooltip-error::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 20px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid #ff4d4f;
}

.tooltip-error.visible {
    opacity: 1;
    transform: translateY(0);
}

.input-container.locked {
    opacity: 0.5 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
}

.input-container.locked * {
    pointer-events: none !important;
}

/* تنظیمات اصلی mode-buttons-scroll */
.mode-buttons-scroll {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  padding: 0 0 0.5rem 0; /* پدینگ بالا و پایین حفظ می‌شود */
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

/* مخفی کردن اسکرول‌بار */
.mode-buttons-scroll::-webkit-scrollbar {
  display: none;
}

/* تنظیمات برای موبایل */
@media (max-width: 768px) {
  .action-mode-buttons {
    margin: 0 -0.5rem; /* جبران پدینگ 0.5rem چپ و راست input-container */
    width: calc(100% + 1rem); /* عرض کامل به علاوه جبران پدینگ */
  }

  .mode-buttons-scroll {
    padding-left: 0; /* حذف پدینگ چپ */
    padding-right: 0; /* حذف پدینگ راست */
    width: 100%; /* عرض کامل */
  }

  /* اعمال پدینگ در ابتدا و انتهای لیست با margin */
  .mode-buttons-scroll > .mode-btn-group:first-child {
    margin-right: 0.5rem; /* فاصله از راست در ابتدا */
    padding-inline: 6px;
  }

  .mode-buttons-scroll > .mode-btn-group:last-child {
    margin-left: 0.5rem; /* فاصله از چپ در انتها */
    padding-left: 6px;
  }

  /* اطمینان از عدم وجود پدینگ چپ و راست اضافی در گروه‌ها */
  .mode-buttons-scroll > .mode-btn-group {
    padding-left: 0;
    padding-right: 0;
  }
}

.mode-btn-group .mode-btn.active[data-mode="suggest-product"] {
    background: transparent !important;
    color: var(--text-primary) !important;
}

.mode-btn-group .mode-btn.active[data-mode="suggest-product"]:hover {
    background: #673ab738 !important;
}

.mode-btn[data-mode="audio-images"] {
    display: none !important;
}