/* مؤسسة دنيا التسالي */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.flash-msg {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === شات المساعد الذكي === */
.chat-panel {
    height: min(520px, calc(100vh - 6rem));
}
.chat-messages {
    scroll-behavior: smooth;
}
.chat-msg {
    display: flex;
    animation: chatIn 0.25s ease;
}
@keyframes chatIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.chat-msg-user {
    justify-content: flex-end;
}
.chat-msg-bot {
    justify-content: flex-start;
}
.chat-bubble {
    max-width: 88%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    line-height: 1.55;
}
.chat-msg-user .chat-bubble {
    background: linear-gradient(135deg, #c86320, #a64d1c);
    color: #fff;
    border-bottom-left-radius: 0.25rem;
}
.chat-msg-bot .chat-bubble {
    background: #fff;
    color: #334155;
    box-shadow: 0 2px 12px rgba(45, 80, 22, 0.08);
    border: 1px solid #f2d4b0;
    border-bottom-right-radius: 0.25rem;
}
.chat-msg-bot.chat-admin .chat-bubble {
    border-color: #86efac;
    background: linear-gradient(135deg, #fff, #ecfdf5);
}
.chat-sender-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #c86320;
    margin-bottom: 0.35rem;
    opacity: 0.9;
}
.chat-body .chat-link {
    color: #c86320;
    font-weight: 600;
    text-decoration: underline;
}
.chat-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.65rem;
}
.chat-action-btn {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid #e9b67d;
    background: #fdf8f3;
    color: #a64d1c;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
}
.chat-action-btn:hover {
    background: #f9ead9;
    transform: translateY(-1px);
}
.chat-action-whatsapp {
    background: #25d366;
    border-color: #20bd5a;
    color: #fff;
}
.chat-action-whatsapp:hover {
    background: #20bd5a;
}
.chat-chip {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    border-radius: 9999px;
    background: #f9ead9;
    color: #a64d1c;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s;
}
.chat-chip:hover {
    background: #f2d4b0;
}
.chat-typing {
    display: flex;
    gap: 4px;
    padding: 0.5rem 0;
}
.chat-typing span {
    width: 7px;
    height: 7px;
    background: #c86320;
    border-radius: 50%;
    animation: chatDot 1.2s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chatDot {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}
#chat-live-dot {
    animation: livePulse 2s infinite;
}
@keyframes livePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
    50% { box-shadow: 0 0 0 4px rgba(74, 222, 128, 0); }
}

/* زر واتساب العائم */
.whatsapp-float {
    animation: whatsapp-pulse 2.5s ease-in-out infinite;
}
@keyframes whatsapp-pulse {
    0%, 100% { box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45); }
    50% { box-shadow: 0 4px 22px rgba(37, 211, 102, 0.75); }
}
/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #fdf8f3; }
::-webkit-scrollbar-thumb { background: #df9249; border-radius: 3px; }
