/* Talki Demo Chat Widget */
.talki-demo { max-width: 520px; margin: 32px auto; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,0.1); background: #F5F7FA; }
.talki-demo__header { background: linear-gradient(135deg, #6C63FF 0%, #4ECDC4 100%); color: white; padding: 18px 24px; font-size: 1.05em; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.talki-demo__header::before { content: ''; display: inline-block; width: 10px; height: 10px; background: #4ADE80; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 2px rgba(74,222,128,0.3); }
.talki-demo__messages { padding: 20px 16px; min-height: 180px; max-height: 380px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.talki-demo__bubble { max-width: 82%; padding: 12px 16px; border-radius: 18px; font-size: 0.95em; line-height: 1.5; animation: bubbleFadeIn 0.35s ease-out; opacity: 0; animation-fill-mode: forwards; }
.talki-demo__bubble--ai { align-self: flex-start; background: white; color: #2C3E50; border: 1.5px solid #E2E0FF; border-bottom-left-radius: 4px; }
.talki-demo__bubble--child { align-self: flex-end; background: #6C63FF; color: white; border-bottom-right-radius: 4px; }
.talki-demo__bubble .speaker { display: block; font-size: 0.75em; font-weight: 600; margin-bottom: 4px; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.5px; }
.talki-demo__typing { align-self: flex-start; display: flex; gap: 5px; padding: 14px 20px; background: white; border-radius: 18px; border: 1.5px solid #E2E0FF; border-bottom-left-radius: 4px; }
.talki-demo__typing span { width: 8px; height: 8px; background: #B0AAFF; border-radius: 50%; animation: typingBounce 1.2s infinite; }
.talki-demo__typing span:nth-child(2) { animation-delay: 0.15s; }
.talki-demo__typing span:nth-child(3) { animation-delay: 0.3s; }
.talki-demo__cta { background: linear-gradient(135deg, #6C63FF 0%, #4ECDC4 100%); padding: 28px 24px; text-align: center; color: white; opacity: 0; transition: opacity 0.5s ease; }
.talki-demo__cta.visible { opacity: 1; }
.talki-demo__cta p { font-size: 1.05em; font-weight: 600; margin-bottom: 14px; }
.talki-demo__cta a { display: inline-block; padding: 12px 28px; background: white; color: #6C63FF; text-decoration: none; border-radius: 30px; font-weight: 700; font-size: 0.95em; transition: transform 0.2s; }
.talki-demo__cta a:hover { transform: translateY(-2px); }
.talki-demo__actions { display: flex; justify-content: center; padding: 12px; background: #F5F7FA; }
.talki-demo__replay { background: none; border: 1.5px solid #6C63FF; color: #6C63FF; padding: 8px 20px; border-radius: 20px; cursor: pointer; font-size: 0.85em; font-weight: 600; transition: background 0.2s, color 0.2s; opacity: 0; transition: opacity 0.3s ease, background 0.2s, color 0.2s; }
.talki-demo__replay.visible { opacity: 1; }
.talki-demo__replay:hover { background: #6C63FF; color: white; }
.talki-demo__replay:focus-visible { outline: 2px solid #6C63FF; outline-offset: 2px; }

/* Language switcher (shared across all pages) */
.lang-switcher { max-width: 800px; margin: 24px auto 0; padding: 16px 20px; text-align: center; }
.lang-switcher a, .lang-switcher span { display: inline-block; padding: 6px 10px; margin: 3px; font-size: 0.85em; text-decoration: none; border-radius: 6px; transition: background 0.2s; }
.lang-switcher a { color: #6C63FF; background: #F0EEFF; }
.lang-switcher a:hover { background: #E2DEFF; }
.lang-switcher span.active { color: white; background: #6C63FF; font-weight: 600; }

/* RTL support */
[dir="rtl"] .talki-demo__bubble--ai { align-self: flex-end; border-bottom-left-radius: 18px; border-bottom-right-radius: 4px; }
[dir="rtl"] .talki-demo__bubble--child { align-self: flex-start; border-bottom-right-radius: 18px; border-bottom-left-radius: 4px; }
[dir="rtl"] .talki-demo__typing { align-self: flex-end; border-bottom-left-radius: 18px; border-bottom-right-radius: 4px; }

/* Animations */
@keyframes bubbleFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes typingBounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

/* Responsive */
@media (max-width: 600px) {
  .talki-demo { margin: 20px 0; border-radius: 12px; }
  .talki-demo__header { padding: 14px 18px; font-size: 0.95em; }
  .talki-demo__messages { padding: 16px 12px; min-height: 150px; max-height: 320px; }
  .talki-demo__bubble { max-width: 88%; font-size: 0.9em; }
  .talki-demo__cta { padding: 22px 18px; }
}
