/* ==========================================================================
   Marjan Medical Center – Floating chat widget
   (WhatsApp button + AI-style chatbot above it)
   ========================================================================== */

:root {
    --mc-chat-accent: #13316D;   /* brand navy */
    --mc-chat-wa: #25D366;       /* WhatsApp green */
}

/* --------------------------------------------------------------------------
   Chatbot hidden site-wide. The widget code & JS stay in place — only the
   robot chat button and its panel are visually hidden. The WhatsApp button
   is unaffected. To bring the chatbot back, delete this block.
   -------------------------------------------------------------------------- */
.mc-fab-chat,
.mc-chat-panel {
    display: none !important;
}

/* Wrapper that stacks the buttons vertically in the bottom-right corner */
.mc-fab-stack {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99990;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

/* Shared round floating buttons */
.mc-fab {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 26px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.mc-fab:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

.mc-fab-whatsapp { background: var(--mc-chat-wa); }
.mc-fab-chat     { background: var(--mc-chat-accent); }

/* Small "online" pulse dot on the chat button */
.mc-fab-chat::after {
    content: "";
    position: absolute;
    top: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #2ecc71;
    border: 2px solid #fff;
    box-shadow: 0 0 0 rgba(46, 204, 113, 0.6);
    animation: mc-pulse 2s infinite;
}

@keyframes mc-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.6); }
    70%  { box-shadow: 0 0 0 10px rgba(46, 204, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

/* When the chat panel is open, swap the chat icon to a close icon look */
.mc-fab-stack.mc-open .mc-fab-chat::after { display: none; }

/* ===== Chat panel ===== */
.mc-chat-panel {
    position: fixed;
    right: 24px;
    bottom: 96px;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 140px);
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 99991;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.96);
    transform-origin: bottom right;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}

.mc-chat-panel.mc-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header */
.mc-chat-header {
    background: var(--mc-chat-accent);
    color: #fff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mc-chat-header .mc-chat-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.mc-chat-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
}

.mc-chat-header span {
    font-size: 12px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 5px;
}

.mc-chat-header span::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ecc71;
    display: inline-block;
}

.mc-chat-close {
    margin-left: auto;
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.85;
    line-height: 1;
}
.mc-chat-close:hover { opacity: 1; }

/* Messages area */
.mc-chat-body {
    flex: 1;
    padding: 18px 16px;
    overflow-y: auto;
    background: #f4f6fb;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mc-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: mc-fadein 0.25s ease;
}

@keyframes mc-fadein {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.mc-msg-bot {
    align-self: flex-start;
    background: #fff;
    color: #1c2440;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.mc-msg-user {
    align-self: flex-end;
    background: var(--mc-chat-accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.mc-msg a {
    color: var(--mc-chat-wa);
    font-weight: 600;
    text-decoration: underline;
    word-break: break-all;
}
.mc-msg-bot a { color: var(--mc-chat-accent); }

/* Map link button inside a message */
.mc-map-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 8px;
    padding: 8px 14px;
    background: var(--mc-chat-accent);
    color: #fff !important;
    border-radius: 10px;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 600;
}
.mc-map-btn:hover { opacity: 0.9; }

/* Quick reply chips */
.mc-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px 12px;
    background: #f4f6fb;
}

.mc-chip {
    background: #fff;
    border: 1px solid #d8dEEF;
    color: var(--mc-chat-accent);
    padding: 7px 12px;
    border-radius: 18px;
    font-size: 12.5px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}
.mc-chip:hover {
    background: var(--mc-chat-accent);
    color: #fff;
}

/* Typing indicator */
.mc-typing {
    align-self: flex-start;
    background: #fff;
    padding: 12px 16px;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    display: flex;
    gap: 4px;
}
.mc-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #b7c0d8;
    animation: mc-bounce 1.2s infinite;
}
.mc-typing span:nth-child(2) { animation-delay: 0.2s; }
.mc-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes mc-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30%           { transform: translateY(-5px); opacity: 1; }
}

/* Input bar */
.mc-chat-input {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #e6e9f2;
    background: #fff;
}

.mc-chat-input input {
    flex: 1;
    border: 1px solid #d8dEEF;
    border-radius: 22px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
}
.mc-chat-input input:focus { border-color: var(--mc-chat-accent); }

.mc-chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--mc-chat-accent);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mc-chat-send:hover { opacity: 0.9; }

/* Mobile */
@media (max-width: 480px) {
    .mc-chat-panel {
        right: 12px;
        left: 12px;
        bottom: 90px;
        width: auto;
        height: 70vh;
    }
    .mc-fab-stack { right: 16px; bottom: 16px; }
}
