/* Feullet de style premium pour le widget de chat public (RTL) */

/* Conteneur global du chat */
.yassar-chat-widget {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9999;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    direction: rtl;
}

/* Bulle flottante de déclenchement */
.yassar-chat-trigger {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0A1C37 0%, #12315c 100%);
    color: #F5C618;
    box-shadow: 0 4px 20px rgba(10, 28, 55, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(245, 198, 24, 0.2);
    outline: none;
}

.yassar-chat-trigger:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 24px rgba(10, 28, 55, 0.4);
    background: linear-gradient(135deg, #12315c 0%, #0A1C37 100%);
}

.yassar-chat-trigger i {
    font-size: 1.6rem;
    transition: transform 0.3s ease;
}

.yassar-chat-trigger.active i {
    transform: rotate(90deg);
}

/* Fenêtre de chat principale */
.yassar-chat-window {
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 360px;
    height: 480px;
    max-height: 80vh;
    max-width: 90vw;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 1px solid rgba(10, 28, 55, 0.08);
}

.yassar-chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* En-tête de la fenêtre */
.yassar-chat-header {
    background: linear-gradient(135deg, #0A1C37 0%, #0B1E3F 100%);
    color: #ffffff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #F5C618;
}

.yassar-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.yassar-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(245, 198, 24, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #F5C618;
    font-size: 1.2rem;
}

.yassar-chat-title-wrapper {
    display: flex;
    flex-direction: column;
}

.yassar-chat-title {
    font-weight: 700;
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
}

.yassar-chat-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 5px;
}

.yassar-chat-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #10b981;
    display: inline-block;
    box-shadow: 0 0 8px #10b981;
}

.yassar-chat-close {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.8;
    transition: all 0.2s ease;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.yassar-chat-close:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.1);
    color: #F5C618;
    transform: rotate(90deg);
}

/* Zone des messages */
.yassar-chat-messages {
    flex-grow: 1;
    background-color: #f8fafc;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Styles des bulles de messages */
.yassar-chat-msg {
    display: flex;
    width: 100%;
}

.yassar-chat-msg.visitor {
    justify-content: flex-start;
}

.yassar-chat-msg.agent {
    justify-content: flex-end;
}

.yassar-chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    animation: bubbleAppear 0.3s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
    position: relative;
}

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

.yassar-chat-msg.visitor .yassar-chat-bubble {
    background-color: #ffffff;
    color: #1e293b;
    border: 1px solid rgba(10, 28, 55, 0.05);
    border-top-right-radius: 2px;
}

.yassar-chat-msg.agent .yassar-chat-bubble {
    background-color: #0A1C37;
    color: #ffffff;
    border-top-left-radius: 2px;
}

.yassar-chat-msg-time {
    font-size: 0.65rem;
    display: block;
    margin-top: 5px;
    text-align: left;
}

.yassar-chat-msg.visitor .yassar-chat-msg-time {
    color: #64748b;
}

.yassar-chat-msg.agent .yassar-chat-msg-time {
    color: rgba(255, 255, 255, 0.6);
}

/* Notification de message */
.yassar-chat-badge-notify {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: #ef4444;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Formulaire d'envoi */
.yassar-chat-footer {
    padding: 12px 15px;
    background-color: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.yassar-chat-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.yassar-chat-input {
    flex-grow: 1;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 0.9rem;
    font-family: 'Tajawal', sans-serif;
    outline: none;
    transition: all 0.2s ease;
    height: 38px;
}

.yassar-chat-input:focus {
    border-color: #0A1C37;
    box-shadow: 0 0 0 2px rgba(10, 28, 55, 0.1);
}

.yassar-chat-send {
    background-color: #0A1C37;
    border: none;
    color: #F5C618;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.yassar-chat-send:hover {
    background-color: #12315c;
    transform: scale(1.05);
}

.yassar-chat-send:disabled {
    background-color: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}

/* Zone d'accueil du chat (quand pas encore de message) */
.yassar-chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    color: #64748b;
    padding: 20px;
    gap: 15px;
}

.yassar-chat-welcome-icon {
    font-size: 2.5rem;
    color: #F5C618;
    background-color: rgba(10, 28, 55, 0.05);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yassar-chat-welcome h4 {
    font-family: 'Cairo', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0A1C37;
    margin: 0;
}

.yassar-chat-welcome p {
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 0;
}

/* Style du bouton d'upload et du preview de fichier */
.yassar-chat-file-btn {
    background: none;
    border: none;
    color: #64748b;
    font-size: 1.25rem;
    cursor: pointer;
    width: 32px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    flex-shrink: 0;
    margin-left: 2px;
}

.yassar-chat-file-btn:hover {
    color: #0A1C37;
}

#yassar-chat-file-preview {
    border-radius: 8px;
    margin-top: 5px;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
}
