/* ===== مساعد البدائع الخيرية - CSS ===== */
:root {
    --badaya-primary: #1a7c4f;
    --badaya-secondary: #25a267;
    --badaya-light: #e8f5ee;
    --badaya-white: #ffffff;
    --badaya-text: #1a1a1a;
    --badaya-gray: #f0f0f0;
    --badaya-shadow: 0 8px 32px rgba(0,0,0,0.18);
    --badaya-radius: 18px;
}

#badaya-chat-bubble {
    position: fixed;
    bottom: 28px;
    left: 28px;
    width: 62px;
    height: 62px;
    background: linear-gradient(135deg, var(--badaya-primary), var(--badaya-secondary));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--badaya-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    outline: none;
}

#badaya-chat-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}

#badaya-chat-bubble svg {
    width: 30px;
    height: 30px;
    fill: white;
}

#badaya-chat-bubble .badaya-notif {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 18px;
    height: 18px;
    background: #e74c3c;
    border-radius: 50%;
    border: 2px solid white;
    display: none;
}

#badaya-chat-window {
    position: fixed;
    bottom: 100px;
    left: 28px;
    width: 370px;
    height: 540px;
    background: var(--badaya-white);
    border-radius: var(--badaya-radius);
    box-shadow: var(--badaya-shadow);
    display: none;
    flex-direction: column;
    z-index: 99998;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    direction: rtl;
    animation: badayaSlideUp 0.25s ease;
}

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

#badaya-chat-header {
    background: linear-gradient(135deg, var(--badaya-primary), var(--badaya-secondary));
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.badaya-avatar {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.badaya-header-info { flex: 1; }
.badaya-header-info h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}
.badaya-header-info span {
    font-size: 12px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 5px;
}
.badaya-online-dot {
    width: 8px; height: 8px;
    background: #a8f0c6;
    border-radius: 50%;
    display: inline-block;
}

#badaya-close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 22px;
    padding: 0;
    opacity: 0.85;
    line-height: 1;
    transition: opacity 0.2s;
}
#badaya-close-btn:hover { opacity: 1; }

#badaya-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

#badaya-messages::-webkit-scrollbar { width: 4px; }
#badaya-messages::-webkit-scrollbar-track { background: transparent; }
#badaya-messages::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.badaya-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
    animation: badayaMsgIn 0.2s ease;
}

@keyframes badayaMsgIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.badaya-msg.bot {
    background: var(--badaya-white);
    color: var(--badaya-text);
    border-radius: 16px 16px 16px 4px;
    align-self: flex-end;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.badaya-msg.user {
    background: linear-gradient(135deg, var(--badaya-primary), var(--badaya-secondary));
    color: white;
    border-radius: 16px 16px 4px 16px;
    align-self: flex-start;
}

.badaya-msg a {
    color: var(--badaya-primary);
    text-decoration: underline;
}
.badaya-msg.user a { color: #a8f0c6; }

.badaya-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 14px;
    background: var(--badaya-white);
    border-radius: 16px 16px 16px 4px;
    align-self: flex-end;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    width: fit-content;
}

.badaya-typing span {
    width: 7px; height: 7px;
    background: var(--badaya-secondary);
    border-radius: 50%;
    animation: badayaDot 1.2s infinite;
}
.badaya-typing span:nth-child(2) { animation-delay: 0.2s; }
.badaya-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes badayaDot {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.badaya-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
    align-self: flex-end;
}

.badaya-quick-btn {
    background: var(--badaya-light);
    color: var(--badaya-primary);
    border: 1.5px solid var(--badaya-secondary);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.badaya-quick-btn:hover {
    background: var(--badaya-secondary);
    color: white;
}

#badaya-input-area {
    padding: 12px 14px;
    background: white;
    border-top: 1px solid #ebebeb;
    display: flex;
    gap: 8px;
    align-items: center;
}

#badaya-input {
    flex: 1;
    border: 1.5px solid #e0e0e0;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: inherit;
    direction: rtl;
    outline: none;
    transition: border-color 0.2s;
    resize: none;
    background: #fafafa;
}
#badaya-input:focus { border-color: var(--badaya-secondary); background: white; }

#badaya-send-btn {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--badaya-primary), var(--badaya-secondary));
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, opacity 0.2s;
    flex-shrink: 0;
}
#badaya-send-btn:hover { transform: scale(1.1); }
#badaya-send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
#badaya-send-btn svg { width: 18px; height: 18px; fill: white; }

@media (max-width: 480px) {
    #badaya-chat-window {
        width: calc(100vw - 20px);
        left: 10px;
        bottom: 90px;
        height: 70vh;
    }
}
