/* Tayibat Live Chat — Canva 3D design (RTL) */
.tayibat-live-chat-wrap {
    max-width: 880px;
    margin: 0 auto;
    position: relative;
}

.tayibat-live-chat-particles {
    position: absolute;
    inset: -40px -20px auto;
    height: 200px;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.tayibat-live-chat-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: tayibat-lc-float 4s ease-in-out infinite;
}

@keyframes tayibat-lc-float {
    0%, 100% { transform: translateY(0) translateX(0); opacity: 0.35; }
    50% { transform: translateY(-18px) translateX(8px); opacity: 0.75; }
}

@keyframes tayibat-lc-pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(1.35); }
}

@keyframes tayibat-lc-typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

@keyframes tayibat-lc-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes tayibat-lc-msg-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes tayibat-lc-glow-ring {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212, 160, 23, 0.45); }
    50% { box-shadow: 0 0 0 10px rgba(212, 160, 23, 0); }
}

@keyframes tayibat-lc-wave {
    0%, 100% { transform: scaleY(0.35); }
    50% { transform: scaleY(1); }
}

.tayibat-live-chat {
    --lc-forest-deep: #1B4332;
    --lc-forest: #2D6A4F;
    --lc-mint: #52B788;
    --lc-gold: #D4A017;
    position: relative;
    z-index: 1;
    min-height: 540px;
    display: flex;
    flex-direction: column;
    border-radius: 24px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 25px 60px rgba(27, 67, 50, 0.2), 0 10px 20px rgba(0, 0, 0, 0.08);
}

.tayibat-live-chat__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--lc-forest-deep), var(--lc-forest));
    color: #fff;
}

.tayibat-live-chat__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(82, 183, 136, 0.35));
    border: 2px solid rgba(183, 228, 196, 0.45);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.tayibat-live-chat__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.3;
}

.tayibat-live-chat__status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.tayibat-live-chat__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4ade80;
    animation: tayibat-lc-pulse-dot 2s infinite;
}

.tayibat-live-chat__status {
    margin: 0;
    font-size: 0.8125rem;
    color: #d8f3dc;
}

.tayibat-live-chat__counter {
    margin-inline-start: auto;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(8px);
    color: #d8f3dc;
}

.tayibat-live-chat__counter.is-low {
    background: rgba(212, 160, 23, 0.35);
    color: #fff;
}

.tayibat-live-chat__counter.is-empty {
    background: rgba(231, 76, 60, 0.35);
    color: #fff;
}

.tayibat-live-chat__counter--vision {
    margin-inline-start: 0;
    background: rgba(212, 160, 23, 0.22);
    border-color: rgba(212, 160, 23, 0.35);
    color: #fef3c7;
}

.tayibat-lc-neo-btn--photo {
    background: rgba(212, 160, 23, 0.12);
    border-color: rgba(212, 160, 23, 0.35);
}

.tayibat-lc-neo-btn--photo:hover {
    background: rgba(212, 160, 23, 0.22);
}

.tayibat-lc-chip--photo {
    border-color: rgba(212, 160, 23, 0.45);
    background: rgba(212, 160, 23, 0.08);
}

.tayibat-lc-msg__bubble--image {
    padding: 8px;
    max-width: 220px;
}

.tayibat-lc-msg__bubble--image img {
    display: block;
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    border-radius: 12px;
}

.tayibat-lc-img-cap {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: #6b7280;
}

.tayibat-lc-vision-previews {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(248, 250, 249, 0.95);
    border-bottom: 1px solid rgba(45, 106, 79, 0.1);
    flex-wrap: wrap;
}

.tayibat-lc-vision-previews__label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #2d6a4f;
    flex-shrink: 0;
}

.tayibat-lc-vision-previews__strip {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tayibat-lc-vision-thumb {
    width: 52px;
    height: 52px;
    padding: 0;
    border: 2px solid rgba(45, 106, 79, 0.25);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: #fff;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.tayibat-lc-vision-thumb:hover {
    transform: scale(1.06);
    border-color: #d4a017;
}

.tayibat-lc-vision-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tayibat-live-chat__messages {
    flex: 1;
    min-height: 280px;
    max-height: 480px;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: linear-gradient(180deg, #f0f7f2, #f8faf9);
    box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.04);
    scroll-behavior: smooth;
}

.tayibat-live-chat__messages::-webkit-scrollbar { width: 5px; }
.tayibat-live-chat__messages::-webkit-scrollbar-track { background: transparent; }
.tayibat-live-chat__messages::-webkit-scrollbar-thumb {
    background: var(--lc-mint);
    border-radius: 10px;
}

.tayibat-lc-msg {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    animation: tayibat-lc-msg-in 0.4s ease-out forwards;
}

.tayibat-lc-msg--user {
    flex-direction: row-reverse;
}

.tayibat-lc-msg__av {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.tayibat-lc-msg--bot .tayibat-lc-msg__av {
    background: linear-gradient(135deg, var(--lc-forest), var(--lc-forest-deep));
    color: #fff;
}

.tayibat-lc-msg--user .tayibat-lc-msg__av {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: var(--lc-forest-deep);
}

.tayibat-lc-msg__bubble {
    max-width: 78%;
    padding: 12px 14px;
    line-height: 1.75;
    font-size: 0.875rem;
}

.tayibat-lc-msg--bot .tayibat-lc-msg__bubble {
    background: #fff;
    color: var(--lc-forest-deep);
    border-radius: 14px 14px 14px 4px;
    border: 1px solid rgba(45, 106, 79, 0.08);
    box-shadow: 0 2px 8px rgba(45, 106, 79, 0.08);
}

.tayibat-lc-msg--user .tayibat-lc-msg__bubble {
    background: linear-gradient(135deg, var(--lc-forest), var(--lc-forest-deep));
    color: #fff;
    border-radius: 14px 14px 4px 14px;
}

.tayibat-lc-msg__bubble strong { font-weight: 700; }

.tayibat-lc-msg--voice .tayibat-lc-msg__bubble {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 72%;
}

.tayibat-lc-voice-play {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tayibat-lc-voice-bars {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    min-width: 60px;
}

.tayibat-lc-voice-bar {
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: rgba(183, 228, 196, 0.9);
    transform-origin: bottom;
    animation: tayibat-lc-wave 0.6s ease-in-out infinite;
}

.tayibat-lc-voice-bar:nth-child(2) { animation-delay: 0.1s; height: 18px; }
.tayibat-lc-voice-bar:nth-child(3) { animation-delay: 0.2s; height: 12px; }
.tayibat-lc-voice-bar:nth-child(4) { animation-delay: 0.3s; height: 20px; }
.tayibat-lc-voice-bar:nth-child(5) { animation-delay: 0.15s; height: 16px; }

.tayibat-lc-voice-dur {
    font-size: 0.7rem;
    font-family: ui-monospace, monospace;
    color: #b7e4c7;
    flex-shrink: 0;
}

.tayibat-lc-typing {
    display: flex;
    gap: 5px;
    padding: 12px 14px;
    background: #fff;
    border-radius: 14px 14px 14px 4px;
    border: 1px solid rgba(45, 106, 79, 0.08);
    box-shadow: 0 0 12px rgba(82, 183, 136, 0.12);
}

.tayibat-lc-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--lc-forest);
    animation: tayibat-lc-typing 1.2s infinite;
}

.tayibat-lc-typing span:nth-child(2) { animation-delay: 0.15s; background: var(--lc-mint); }
.tayibat-lc-typing span:nth-child(3) { animation-delay: 0.3s; background: #b7e4c7; }

.tayibat-lc-stream-cursor {
    animation: tayibat-lc-blink 0.8s infinite;
    color: var(--lc-gold);
    font-weight: 700;
}

.tayibat-live-chat__foot {
    padding: 12px 14px;
    border-top: 1px solid rgba(45, 106, 79, 0.1);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(8px);
}

.tayibat-live-chat__form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.tayibat-live-chat__input {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    resize: none;
    padding: 10px 14px;
    border: 1px solid rgba(45, 106, 79, 0.22);
    border-radius: 16px;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #374151;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tayibat-live-chat__input:focus {
    outline: none;
    border-color: var(--lc-forest);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.12);
}

.tayibat-lc-neo-btn {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #fff, #e8e8e8);
    box-shadow: 4px 4px 8px #d1d1d1, -4px -4px 8px #fff, inset 0 1px 0 rgba(255, 255, 255, 0.85);
    transition: box-shadow 0.2s, transform 0.15s, background 0.2s;
}

.tayibat-lc-neo-btn:hover {
    box-shadow: 2px 2px 4px #d1d1d1, -2px -2px 4px #fff;
}

.tayibat-lc-neo-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.tayibat-lc-neo-btn.is-recording {
    background: linear-gradient(135deg, var(--lc-gold), #e67e22);
    animation: tayibat-lc-glow-ring 1s infinite;
}

.tayibat-lc-neo-btn.is-speaking {
    background: linear-gradient(145deg, #ecfdf5, #d1fae5);
    box-shadow: 0 0 0 2px rgba(82, 183, 136, 0.35);
}

.tayibat-lc-neo-btn svg { display: block; }

.tayibat-lc-send-btn {
    flex-shrink: 0;
    height: 44px;
    padding: 0 18px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--lc-forest), var(--lc-forest-deep));
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.14), 0 6px 18px rgba(27, 67, 50, 0.2);
    transition: transform 0.15s, box-shadow 0.15s;
}

.tayibat-lc-send-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.tayibat-lc-send-btn:active:not(:disabled) {
    transform: translateY(3px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.14);
}

.tayibat-lc-send-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.tayibat-live-chat__hint {
    margin: 8px 2px 0;
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: center;
}

.tayibat-live-chat-qq {
    margin-top: 24px;
    position: relative;
    z-index: 1;
}

.tayibat-live-chat-qq__title {
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--lc-forest-deep);
    margin: 0 0 14px;
}

.tayibat-live-chat-qq__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.tayibat-lc-qq-pill {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(45, 106, 79, 0.2);
    background: #fff;
    font-family: inherit;
    font-size: 0.82rem;
    color: var(--lc-forest);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: background 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.tayibat-lc-qq-pill:hover {
    background: var(--lc-forest);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 106, 79, 0.28);
}

@media (max-width: 640px) {
    .tayibat-live-chat__messages { max-height: 400px; min-height: 240px; }
    .tayibat-lc-msg__bubble { max-width: 88%; }
    .tayibat-lc-send-btn span.tayibat-lc-send-label { display: none; }
}

/* ── صفحة المساعد الذكي (ai-assistant) ───────────────── */
.tayibat-live-chat-wrap--ai {
    max-width: 920px;
    margin: 0 auto;
}

.tayibat-live-chat--ai {
    max-width: 100%;
}

.tayibat-live-chat--ai .tayibat-live-chat__messages-shell {
    flex: 1;
    min-height: 340px;
    max-height: 520px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tayibat-live-chat--ai .tayibat-live-chat__messages {
    min-height: 0;
    max-height: none;
    flex: 1;
}

.tayibat-live-chat__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 16px 0;
    border-bottom: 1px solid rgba(45, 106, 79, 0.06);
}

.tayibat-lc-chip {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(45, 106, 79, 0.2);
    background: rgba(45, 106, 79, 0.05);
    color: var(--lc-forest, #2D6A4F);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.tayibat-lc-chip:hover {
    background: var(--lc-forest, #2D6A4F);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 106, 79, 0.28);
}

.tayibat-lc-msg__bubble--rich p { margin: 0 0 6px; }
.tayibat-lc-msg__bubble--rich ul { margin: 6px 0; padding-inline-start: 20px; }
.tayibat-lc-msg__bubble--rich li { margin-bottom: 3px; }
.tayibat-lc-msg__bubble--rich strong { color: var(--lc-forest-deep, #1B4332); }
.tayibat-lc-muted { color: #888; font-size: 0.85rem; margin-top: 8px; }

.tayibat-lc-msg--user .tayibat-lc-msg__av {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: var(--lc-forest-deep, #1B4332);
}

.tayibat-lc-msg--error .tayibat-lc-msg__bubble {
    background: #fef2f2;
    border: 1px solid rgba(231, 76, 60, 0.2);
    color: #c0392b;
}

.tayibat-lc-msg--warn .tayibat-lc-msg__bubble {
    background: linear-gradient(160deg, #fffbeb, #fef3c7);
    border: 1px solid rgba(212, 160, 23, 0.35);
    color: #92400e;
}

.tayibat-live-chat__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.75rem;
    color: #9ca3af;
}

.tayibat-live-chat__meta kbd {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.7rem;
    font-family: ui-monospace, monospace;
}

.tayibat-lc-char-count { color: #9ca3af; }
.tayibat-lc-char-count.is-warn { color: #e74c3c; font-weight: 700; }

.tayibat-lc-status {
    font-weight: 700;
    color: var(--lc-forest, #2D6A4F);
}

.tayibat-live-chat__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px 14px;
    border-top: 1px solid rgba(45, 106, 79, 0.06);
}

.tayibat-lc-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 10px;
    border: 1px solid rgba(45, 106, 79, 0.15);
    background: #f6fbf8;
    color: var(--lc-forest, #2D6A4F);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

.tayibat-lc-tool-btn:hover {
    background: rgba(45, 106, 79, 0.08);
    border-color: rgba(45, 106, 79, 0.25);
}

.tayibat-lc-tool-btn--accent {
    background: linear-gradient(135deg, var(--lc-forest, #2D6A4F), #40916c);
    color: #fff !important;
    border-color: transparent;
}

.tayibat-lc-tool-btn--accent:hover {
    box-shadow: 0 4px 12px rgba(45, 106, 79, 0.35);
}

@media (max-width: 640px) {
    .tayibat-live-chat__chips { padding: 10px 12px 0; }
    .tayibat-lc-chip { font-size: 0.77rem; padding: 6px 11px; }
    .tayibat-live-chat--ai .tayibat-live-chat__messages-shell { min-height: 260px; max-height: 400px; }
    .tayibat-live-chat__toolbar { padding: 8px 12px 12px; }
    .tayibat-lc-tool-btn { font-size: 0.75rem; padding: 6px 10px; }
}
