/**
 * Medicate International - Chatbot & Push Notifications Styles
 */

/* ===== CHATBOT WIDGET ===== */
.chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    left: auto;
    z-index: 99998;
    font-family: 'Cairo', sans-serif;
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1A5276, #2980b9);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 5px 25px rgba(26,82,118,0.4);
    transition: all 0.3s;
    position: relative;
}
.chatbot-toggle:hover { transform: scale(1.1); }
.chatbot-icon-close { display: none; }
.chatbot-open .chatbot-icon-open { display: none; }
.chatbot-open .chatbot-icon-close { display: inline; }

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    background: #e74c3c;
    border-radius: 50%;
    color: #fff;
    font-size: 0.7rem;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    animation: pulse 1.5s infinite;
}

.chatbot-window {
    position: absolute;
        bottom: 75px;
        right: 0;
        left: auto;
    width: 380px;
    max-height: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}
.chatbot-open .chatbot-window { display: flex; }

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

.chatbot-header {
    background: linear-gradient(135deg, #1A5276, #2980b9);
    color: #fff;
    padding: 15px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.chatbot-header-info { display: flex; align-items: center; gap: 10px; }
.chatbot-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.chatbot-header-info strong { font-size: 0.95rem; display: block; }
.chatbot-status { font-size: 0.7rem; opacity: 0.85; }
.chatbot-status i { font-size: 0.5rem; color: #2ecc71; margin-left: 4px; }
.chatbot-minimize {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
}
.chatbot-minimize:hover { background: rgba(255,255,255,0.3); }

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    max-height: 320px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8f9fa;
}

.chat-msg { display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.bot { justify-content: flex-start; }

.chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.6;
    white-space: pre-line;
}
.chat-msg.user .chat-bubble {
    background: #1A5276;
    color: #fff;
    border-bottom-left-radius: 4px;
}
.chat-msg.bot .chat-bubble {
    background: #fff;
    color: #333;
    border-bottom-right-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
}

/* Typing indicator */
.typing-dots { display: flex; gap: 4px; padding: 5px 0; }
.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typingBounce 1.4s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

.chatbot-input {
    display: flex;
    padding: 10px 12px;
    border-top: 1px solid #e0e0e0;
    gap: 8px;
    background: #fff;
}
.chatbot-input input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 0.85rem;
    outline: none;
    font-family: 'Cairo', sans-serif;
    transition: border-color 0.3s;
}
.chatbot-input input:focus { border-color: #1A5276; }
#chatbot-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #1A5276;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
#chatbot-send:hover { background: #2980b9; transform: scale(1.05); }

.chatbot-quick-actions {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    overflow-x: auto;
    background: #fff;
    border-top: 1px solid #f0f0f0;
}
.chatbot-quick-actions button {
    white-space: nowrap;
    padding: 6px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    background: #f8f9fa;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Cairo', sans-serif;
}
.chatbot-quick-actions button:hover { background: #1A5276; color: #fff; border-color: #1A5276; }

/* ===== PUSH NOTIFICATION PROMPT ===== */
.push-prompt {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #fff;
    border-radius: 14px;
    padding: 18px 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 99999;
    opacity: 0;
    transition: all 0.4s;
    max-width: 420px;
    width: 90%;
}
.push-prompt.push-show { opacity: 1; transform: translateX(-50%) translateY(0); }

.push-prompt-content { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.push-prompt-icon { font-size: 1.8rem; color: #f39c12; animation: ring 2s infinite; }
.push-prompt-text strong { display: block; font-size: 0.9rem; color: #1A5276; margin-bottom: 3px; }
.push-prompt-text span { font-size: 0.8rem; color: #666; }
.push-prompt-actions { display: flex; gap: 8px; margin-top: 10px; width: 100%; }
.push-allow {
    padding: 8px 18px;
    background: #1A5276;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}
.push-allow:hover { background: #2980b9; }
.push-deny {
    padding: 8px 18px;
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}
.push-deny:hover { background: #e0e0e0; }

@keyframes ring {
    0%, 100% { transform: rotate(0); }
    10%, 30% { transform: rotate(15deg); }
    20%, 40% { transform: rotate(-15deg); }
    50% { transform: rotate(0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .chatbot-window {
        width: calc(100vw - 40px);
        max-height: 70vh;
        bottom: 70px;
    }
    .chatbot-widget { bottom: 15px; right: 15px; left: auto; }
    .push-prompt { max-width: 90%; }
}

/* ===== DARK MODE ===== */
[data-theme="dark"] .chatbot-window { background: #1e1e1e; }
[data-theme="dark"] .chatbot-messages { background: #121212; }
[data-theme="dark"] .chat-msg.bot .chat-bubble { background: #2d2d2d; color: #eee; }
[data-theme="dark"] .chatbot-input { background: #1e1e1e; border-color: #333; }
[data-theme="dark"] .chatbot-input input { background: #2d2d2d; border-color: #444; color: #fff; }
[data-theme="dark"] .chatbot-quick-actions { background: #1e1e1e; border-color: #333; }
[data-theme="dark"] .chatbot-quick-actions button { background: #2d2d2d; border-color: #444; color: #ccc; }
[data-theme="dark"] .push-prompt { background: #2d2d2d; }
[data-theme="dark"] .push-prompt-text strong { color: #7ec8e3; }
[data-theme="dark"] .push-prompt-text span { color: #bbb; }
