/**
 * Egypt Nour - Interactive AI Travel Assistant Styles
 * Matching Site Palette: Navy (#073B66), Cyan (#00A3C4), White (#FFFFFF)
 * Includes: Robot Launcher, Responsive Chat Panel, Virtual Keyboard, Assistant Cursor Overlay, and RTL Support
 */

:root {
  --ai-navy: #073B66;
  --ai-navy-dark: #04213B;
  --ai-cyan: #00A3C4;
  --ai-cyan-bright: #0BD0F4;
  --ai-cyan-glow: rgba(0, 163, 196, 0.4);
  --ai-gold: #E5A93C;
  --ai-bg-glass: rgba(255, 255, 255, 0.95);
  --ai-text-dark: #1E293B;
  --ai-text-muted: #64748B;
  --ai-border: rgba(7, 59, 102, 0.12);
  --ai-radius-lg: 20px;
  --ai-radius-md: 14px;
  --ai-shadow-float: 0 16px 40px rgba(7, 59, 102, 0.18), 0 4px 12px rgba(0, 163, 196, 0.15);
  --ai-shadow-glow: 0 0 25px rgba(0, 163, 196, 0.45);
}

/* -------------------------------------------------------------
   1. FLOATING ROBOT LAUNCHER
   Avoids overlapping .back-top (right: 18px; bottom: 18px)
------------------------------------------------------------- */
#ai-assistant-launcher {
  position: fixed;
  right: 22px;
  bottom: 86px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#ai-assistant-launcher:hover {
  transform: translateY(-3px) scale(1.03);
}

/* Tooltip Pill */
.ai-launcher-tooltip {
  background: var(--ai-navy);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(7, 59, 102, 0.25);
  border: 1px solid rgba(0, 163, 196, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  animation: aiPillFloat 3s ease-in-out infinite;
}

.ai-launcher-tooltip .ai-tooltip-close {
  opacity: 0.7;
  cursor: pointer;
  margin-left: 4px;
}
.ai-launcher-tooltip .ai-tooltip-close:hover {
  opacity: 1;
}

@keyframes aiPillFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Robot Button Orb */
.ai-robot-orb {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(145deg, #0A4A80 0%, #073B66 60%, #032442 100%);
  border: 2px solid var(--ai-cyan);
  box-shadow: 0 10px 30px rgba(7, 59, 102, 0.35), var(--ai-shadow-glow);
  display: grid;
  place-items: center;
  position: relative;
  overflow: visible;
  transition: all 0.3s ease;
}

.ai-robot-orb:hover {
  box-shadow: 0 12px 35px rgba(0, 163, 196, 0.5), 0 0 30px rgba(11, 208, 244, 0.6);
  border-color: var(--ai-cyan-bright);
}

/* Pulsing Online Ring */
.ai-robot-orb::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--ai-cyan);
  opacity: 0;
  animation: aiRingPulse 2.8s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  pointer-events: none;
}

@keyframes aiRingPulse {
  0% { transform: scale(0.85); opacity: 0.8; }
  60% { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1.25); opacity: 0; }
}

/* Robot SVG Animation States */
.ai-robot-svg {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}

/* Idle Floating */
.ai-robot-state-idle .ai-robot-head {
  animation: aiHeadFloat 3.5s ease-in-out infinite;
  transform-origin: center center;
}
@keyframes aiHeadFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.ai-robot-eyes {
  transform-origin: center center;
  animation: aiEyesBlink 4s infinite;
}
@keyframes aiEyesBlink {
  0%, 94%, 98%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(0.1); }
}

/* Thinking Animation */
.ai-robot-state-thinking .ai-robot-orb {
  border-color: var(--ai-cyan-bright);
  box-shadow: 0 0 25px rgba(11, 208, 244, 0.7);
}
.ai-robot-state-thinking .ai-antenna-orb {
  animation: aiAntennaPulse 0.8s alternate infinite;
}
@keyframes aiAntennaPulse {
  from { fill: #00A3C4; filter: drop-shadow(0 0 2px #00A3C4); }
  to { fill: #0BD0F4; filter: drop-shadow(0 0 10px #0BD0F4); }
}

/* Typing Animation */
.ai-robot-state-typing .ai-robot-mouth {
  animation: aiMouthChatter 0.4s alternate infinite;
}
@keyframes aiMouthChatter {
  from { transform: scaleX(0.8); }
  to { transform: scaleX(1.2); }
}

/* Success Animation */
.ai-robot-state-success .ai-robot-orb {
  border-color: #22C55E;
  box-shadow: 0 0 30px rgba(34, 197, 94, 0.6);
  animation: aiSuccessBounce 0.6s ease;
}
@keyframes aiSuccessBounce {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.15) translateY(-6px); }
  70% { transform: scale(0.95); }
}

/* -------------------------------------------------------------
   2. RESPONSIVE CHAT PANEL
------------------------------------------------------------- */
#ai-assistant-panel {
  position: fixed;
  right: 22px;
  bottom: 160px;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 590px;
  max-height: calc(100vh - 180px);
  background: var(--ai-bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius-lg);
  box-shadow: var(--ai-shadow-float);
  display: flex;
  flex-direction: column;
  z-index: 10000;
  overflow: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
  visibility: visible;
  opacity: 1;
  transform: translateY(0) scale(1);
}

#ai-assistant-panel.ai-panel-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
}

/* Panel Header */
.ai-panel-header {
  background: linear-gradient(135deg, var(--ai-navy) 0%, #0A4A80 100%);
  color: #ffffff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid rgba(0, 163, 196, 0.4);
}

.ai-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-header-avatar {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.1);
  border: 1.5px solid var(--ai-cyan);
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
}

.ai-header-avatar::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 9px;
  height: 9px;
  background: #22C55E;
  border: 2px solid var(--ai-navy);
  border-radius: 50%;
}

.ai-header-info h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.ai-header-info span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  gap: 4px;
}

.ai-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-btn-icon {
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.ai-btn-icon:hover {
  background: rgba(0, 163, 196, 0.4);
  color: var(--ai-cyan-bright);
}

/* Automated Workflow Status Banner */
.ai-workflow-status-bar {
  background: #EFF6FF;
  border-bottom: 1px solid #BFDBFE;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #1E40AF;
  font-weight: 600;
}

.ai-workflow-status-bar.hidden {
  display: none;
}

.ai-workflow-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-ctrl-btn {
  background: #ffffff;
  border: 1px solid #93C5FD;
  color: #1E3A8A;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.ai-ctrl-btn:hover {
  background: #DBEAFE;
}

.ai-ctrl-btn.skip {
  background: var(--ai-cyan);
  color: #ffffff;
  border-color: var(--ai-cyan);
}
.ai-ctrl-btn.skip:hover {
  background: #008AA7;
}

/* Chat Messages Stream */
.ai-messages-container {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.ai-msg {
  display: flex;
  gap: 10px;
  max-width: 88%;
  animation: aiMsgFadeIn 0.25s ease-out;
}

@keyframes aiMsgFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-msg.assistant {
  align-self: flex-start;
}

.ai-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ai-navy);
  border: 1px solid var(--ai-cyan);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #ffffff;
  font-size: 12px;
}

.ai-msg-bubble {
  padding: 12px 15px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.45;
  word-break: break-word;
  position: relative;
}

.ai-msg.user .ai-msg-bubble {
  background: linear-gradient(135deg, var(--ai-cyan) 0%, #008AA7 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(0, 163, 196, 0.25);
}

.ai-msg.assistant .ai-msg-bubble {
  background: #F1F5F9;
  color: var(--ai-text-dark);
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(7, 59, 102, 0.08);
}

/* Tour Cards inside Chat */
.ai-tour-card {
  background: #ffffff;
  border-radius: var(--ai-radius-md);
  border: 1px solid #E2E8F0;
  overflow: hidden;
  margin-top: 10px;
  box-shadow: 0 6px 18px rgba(7, 59, 102, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.ai-tour-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(7, 59, 102, 0.14);
}

.ai-tour-img-wrap {
  width: 100%;
  height: 120px;
  position: relative;
  overflow: hidden;
  background: #CBD5E1;
}

.ai-tour-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.ai-tour-card:hover .ai-tour-img-wrap img {
  transform: scale(1.05);
}

.ai-tour-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(7, 59, 102, 0.85);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

.ai-tour-body {
  padding: 12px;
}

.ai-tour-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ai-navy);
  margin-bottom: 6px;
  line-height: 1.3;
}

.ai-tour-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--ai-text-muted);
}

.ai-tour-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--ai-cyan);
}

.ai-tour-actions {
  display: flex;
  gap: 8px;
}

.ai-tour-btn-select {
  flex: 1;
  background: linear-gradient(135deg, var(--ai-navy) 0%, var(--ai-cyan) 100%);
  color: #ffffff;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.2s, transform 0.15s;
}

.ai-tour-btn-select:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.ai-tour-btn-view {
  background: #F1F5F9;
  color: var(--ai-navy);
  border: 1px solid #CBD5E1;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  text-decoration: none;
  font-weight: 600;
  display: grid;
  place-items: center;
}
.ai-tour-btn-view:hover {
  background: #E2E8F0;
  color: var(--ai-navy);
}

/* Review Summary Card (Interactive In-Chat Form) */
.ai-review-card {
  background: #ffffff;
  border: 1.5px solid var(--ai-cyan);
  border-radius: var(--ai-radius-md);
  padding: 14px;
  margin-top: 10px;
  box-shadow: 0 8px 24px rgba(7, 59, 102, 0.08);
}

.ai-review-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ai-navy);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #E2E8F0;
  padding-bottom: 8px;
}

.ai-review-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-review-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-review-item-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ai-text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.ai-review-input,
.ai-review-select {
  width: 100%;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12.5px;
  color: var(--ai-text-dark);
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
  box-sizing: border-box;
}

.ai-review-input:focus,
.ai-review-select:focus {
  background: #ffffff;
  border-color: var(--ai-cyan);
  box-shadow: 0 0 0 3px rgba(0, 163, 196, 0.18);
}

.ai-review-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ai-review-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.ai-review-confirm-btn {
  width: 100%;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  transition: all 0.2s;
}

.ai-review-confirm-btn:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
}

.ai-review-fill-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--ai-navy) 0%, var(--ai-cyan) 100%);
  color: #ffffff;
  border: none;
  padding: 9px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.ai-review-fill-btn:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}


.ai-review-confirm-btn:hover {
  background: #16A34A;
}

/* Quick Suggestion Chips */
.ai-quick-chips {
  padding: 8px 16px 4px 16px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ai-quick-chips::-webkit-scrollbar {
  display: none;
}

.ai-chip {
  background: #F1F5F9;
  border: 1px solid rgba(7, 59, 102, 0.1);
  color: var(--ai-navy);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
}
.ai-chip:hover {
  background: var(--ai-cyan);
  color: #ffffff;
  border-color: var(--ai-cyan);
}

/* Chat Input Bar */
.ai-input-bar {
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid var(--ai-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-chat-input {
  flex: 1;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 13.5px;
  color: var(--ai-text-dark);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ai-chat-input:focus {
  border-color: var(--ai-cyan);
  box-shadow: 0 0 0 3px rgba(0, 163, 196, 0.15);
  background: #ffffff;
}

.ai-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ai-navy) 0%, var(--ai-cyan) 100%);
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 14px;
  transition: transform 0.15s, opacity 0.15s;
  flex-shrink: 0;
}

.ai-send-btn:hover {
  transform: scale(1.05);
}

/* -------------------------------------------------------------
   3. SEPARATE ASSISTANT CURSOR OVERLAY
   Independent from visitor pointer; strictly pointer-events: none
------------------------------------------------------------- */
#ai-assistant-cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none !important;
  z-index: 1000001;
  transform: translate(-50%, -50%);
  transition: left 0.45s cubic-bezier(0.22, 1, 0.36, 1), top 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  display: none;
  will-change: left, top;
}

.ai-cursor-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-cursor-pointer {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 4px 8px rgba(0, 163, 196, 0.5));
  animation: aiCursorGlow 1.8s ease-in-out infinite alternate;
}

@keyframes aiCursorGlow {
  from { filter: drop-shadow(0 2px 6px rgba(0, 163, 196, 0.5)); }
  to { filter: drop-shadow(0 4px 14px rgba(11, 208, 244, 0.9)); }
}

.ai-cursor-label {
  background: var(--ai-navy);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--ai-cyan-bright);
  box-shadow: 0 4px 14px rgba(7, 59, 102, 0.35);
  white-space: nowrap;
}

/* Ripple effect on click target */
.ai-cursor-ripple {
  position: fixed;
  pointer-events: none;
  z-index: 1000000;
  border-radius: 50%;
  border: 2px solid var(--ai-cyan-bright);
  background: rgba(0, 163, 196, 0.2);
  transform: translate(-50%, -50%) scale(0.2);
  animation: aiRippleExpand 0.55s ease-out forwards;
}

@keyframes aiRippleExpand {
  0% { transform: translate(-50%, -50%) scale(0.2); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; }
}

/* Field Focus Highlight */
.ai-field-highlight {
  outline: none !important;
  border-color: var(--ai-cyan) !important;
  box-shadow: 0 0 0 3px rgba(0, 163, 196, 0.4), 0 8px 24px rgba(0, 163, 196, 0.25) !important;
  transition: box-shadow 0.25s, border-color 0.25s;
}

/* -------------------------------------------------------------
   4. ANIMATED MULTILINGUAL VIRTUAL KEYBOARD
------------------------------------------------------------- */
#ai-virtual-keyboard {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(0);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--ai-radius-lg);
  padding: 12px 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 30px rgba(0, 163, 196, 0.25);
  z-index: 100005;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: auto;
  max-width: 95vw;
  user-select: none;
  pointer-events: auto;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

#ai-virtual-keyboard.keyboard-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(40px);
  pointer-events: none;
}

.ai-kb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 6px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
  color: #94A3B8;
  font-weight: 600;
}

.ai-kb-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ai-cyan-bright);
}

.ai-kb-skip-btn {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  cursor: pointer;
  transition: background 0.15s;
}
.ai-kb-skip-btn:hover {
  background: var(--ai-cyan);
  border-color: var(--ai-cyan);
}

.ai-kb-row {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.ai-kb-key {
  min-width: 28px;
  height: 32px;
  padding: 0 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #F8FAFC;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.08s ease-out;
}

.ai-kb-key.key-wide {
  min-width: 50px;
}

.ai-kb-key.key-space {
  min-width: 140px;
}

/* Key Active Light-up Sync with Character */
.ai-kb-key.key-active {
  background: var(--ai-cyan-bright) !important;
  color: var(--ai-navy-dark) !important;
  border-color: #ffffff !important;
  box-shadow: 0 0 16px rgba(11, 208, 244, 0.9), inset 0 2px 4px rgba(255,255,255,0.6);
  transform: translateY(2px) scale(0.96);
}

/* -------------------------------------------------------------
   5. ARABIC RTL STYLES
------------------------------------------------------------- */
[dir="rtl"] #ai-assistant-launcher,
body.rtl #ai-assistant-launcher {
  right: auto;
  left: 22px;
  flex-direction: row-reverse;
}

[dir="rtl"] #ai-assistant-panel,
body.rtl #ai-assistant-panel {
  right: auto;
  left: 22px;
  direction: rtl;
}

[dir="rtl"] .ai-msg.user,
body.rtl .ai-msg.user {
  align-self: flex-start;
  flex-direction: row-reverse;
}

[dir="rtl"] .ai-msg.assistant,
body.rtl .ai-msg.assistant {
  align-self: flex-end;
}

[dir="rtl"] .ai-tour-badge,
body.rtl .ai-tour-badge {
  right: auto;
  left: 8px;
}

[dir="rtl"] .ai-review-item-val,
body.rtl .ai-review-item-val {
  text-align: left;
}

/* -------------------------------------------------------------
   6. RESPONSIVE MOBILE BREAKPOINTS
------------------------------------------------------------- */
@media (max-width: 1050px) {
  #ai-assistant-launcher {
    right: 14px;
    bottom: 175px; /* Sits above .back-top at bottom: 112px */
  }

  [dir="rtl"] #ai-assistant-launcher,
  body.rtl #ai-assistant-launcher {
    right: auto;
    left: 14px;
    bottom: 175px;
  }

  #ai-assistant-panel {
    right: 0;
    left: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    height: 85vh;
    max-height: 85vh;
    border-radius: 24px 24px 0 0;
  }

  #ai-virtual-keyboard {
    bottom: 10px;
    max-width: 98vw;
    padding: 8px;
    gap: 4px;
  }
  .ai-kb-key {
    min-width: 22px;
    height: 28px;
    font-size: 11px;
    padding: 0 3px;
  }
}

/* -------------------------------------------------------------
   7. ACCESSIBILITY: REDUCED MOTION PREFERENCE
------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  #ai-assistant-launcher,
  #ai-assistant-cursor,
  .ai-launcher-tooltip,
  .ai-robot-head,
  .ai-robot-eyes,
  .ai-robot-orb::before,
  .ai-cursor-ripple {
    animation: none !important;
    transition: none !important;
  }
}
