/**
 * i18n.css — 多语言样式适配
 * 主要处理 RTL（从右到左）语言的布局镜像
 */

/* ====== RTL 模式（阿拉伯语）====== */
html[dir="rtl"] .chat-container,
.rtl-mode .chat-container {
  direction: rtl;
}

/* 消息气泡方向反转 */
html[dir="rtl"] .msg-row.right .bubble,
.rtl-mode .msg-row.right .bubble {
  margin-left: auto;
  margin-right: 0;
}

html[dir="rtl"] .msg-row.left .bubble,
.rtl-mode .msg-row.left .bubble {
  margin-left: 0;
  margin-right: auto;
}

/* 输入区域方向反转 */
html[dir="rtl"] .input-area,
.rtl-mode .input-area {
  flex-direction: row-reverse;
}

/* 头部按钮组方向反转 */
html[dir="rtl"] .header-right,
.rtl-mode .header-right {
  flex-direction: row-reverse;
}

/* 名片卡片 RTL */
html[dir="rtl"] .contact-card .card-body,
.rtl-mode .contact-card .card-body {
  flex-direction: row-reverse;
}

html[dir="rtl"] .card-qr,
.rtl-mode .card-qr {
  order: -1; /* 二维码放到左边 */
}

/* 表单标签对齐 */
html[dir="rtl"] .lead-label,
.rtl-mode .lead-label {
  text-align: right;
}

/* ====== 语言选择器（演示模式） ====== */

/* 语言选择按钮 - 位于浮动按钮上方 */
.lang-selector-btn {
  position: fixed;
  bottom: 96px;
  right: 28px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981, #059669);
  border: none;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: all 0.3s ease;
  z-index: 999;
}

.lang-selector-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 22px rgba(16, 185, 129, 0.5);
}

.lang-selector-btn svg {
  width: 22px;
  height: 22px;
  color: white;
}

.lang-selector-btn span {
  font-size: 11px;
  color: white;
  font-weight: 600;
}

/* 语言选择弹窗 */
.lang-popup {
  position: fixed;
  bottom: 160px;
  right: 28px;
  width: 200px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.lang-popup.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
}

.lang-popup-header span {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.lang-popup-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.lang-popup-close:hover {
  background: #f5f5f5;
  color: #666;
}

.lang-popup-body {
  padding: 8px;
}

.lang-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.lang-option:hover {
  background: #f5f5f5;
}

.lang-option.active {
  background: #ecfdf5;
}

.lang-flag {
  font-size: 18px;
}

.lang-name {
  flex: 1;
  font-size: 14px;
  color: #333;
}

.lang-option.active .lang-name {
  color: #059669;
  font-weight: 600;
}

.lang-check {
  font-size: 14px;
  color: #10B981;
  opacity: 0;
}

.lang-option.active .lang-check {
  opacity: 1;
}

.lang-popup-footer {
  padding: 8px 16px;
  border-top: 1px solid #f0f0f0;
  text-align: center;
}

.lang-popup-footer span {
  font-size: 11px;
  color: #999;
}

/* 遮罩层 */
.lang-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.lang-popup-overlay.active {
  opacity: 1;
  visibility: visible;
}
