/* ═══════════════════════════════════════════════
   RAAH-E-AAKHIRAH — FAQ CHATBOT WIDGET
   Self-contained styles. Uses the site's existing
   Poppins / Inter fonts. Safe to append to style.css
   or keep as its own file.
═══════════════════════════════════════════════ */

:root {
    --bot-teal: #0f766e;
    --bot-teal-600: #0b6974;
    --bot-teal-dark: #0b5c56;
    --bot-gold: #c9a24b;
    --bot-sand: #f7f4ee;
    --bot-ink: #1f2937;
    --bot-ink-soft: #6b7280;
    --bot-white: #ffffff;
    --bot-radius: 16px;
    --bot-shadow: 0 18px 40px rgba(15, 60, 55, 0.22);
}

/* ---------- Toggle button ---------- */
.rah-bot-toggle {
    position: fixed;
    right: 26px;
    bottom: 96px; /* sits above the existing WhatsApp float (bottom:30px) */
    z-index: 9998;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--bot-shadow);
    transition: transform 0.2s ease, background 0.2s ease;
    border: 2px solid var(--bot-teal-600);
}
.rah-bot-toggle:hover {  transform: translateY(-2px); }
.rah-bot-toggle svg { width: 26px; height: 26px; }
.rah-bot-toggle .rah-bot-close-icon { display: none; }
.rah-bot-toggle.open .rah-bot-toggle-logo,
.rah-bot-toggle.open .rah-bot-chat-icon { display: none; }
.rah-bot-toggle.open .rah-bot-close-icon { display: block; }

.rah-bot-toggle-logo {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
}
 
/* ---------- Panel ---------- */
.rah-bot-panel {
    position: fixed;
    right: 24px;
    bottom: 164px;
    z-index: 9998;
    width: 366px;
    max-width: calc(100vw - 32px);
    height: 512px;
    max-height: calc(100vh - 190px);
    background: var(--bot-white);
    border-radius: var(--bot-radius);
    box-shadow: var(--bot-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.97);
    transform-origin: bottom right;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(.2,.8,.3,1), transform 0.25s cubic-bezier(.2,.8,.3,1);
    font-family: 'Inter', sans-serif;
}
.rah-bot-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
 
.rah-bot-header {
    position: relative;
    background: linear-gradient(135deg, var(--bot-teal), var(--bot-teal-dark));
    color: var(--bot-white);
    padding: 17px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    overflow: hidden;
}
.rah-bot-header::after {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    pointer-events: none;
}
.rah-bot-header img,
.rah-bot-logo-fallback {
    position: relative;
    z-index: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.55);
}
.rah-bot-logo-fallback {
    background: var(--bot-gold);
    color: var(--bot-teal-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}
.rah-bot-header-text { position: relative; z-index: 1; }
.rah-bot-header-text h4 {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    line-height: 1.25;
}
.rah-bot-header-text span {
    font-size: 12px;
    opacity: 0.88;
    display: flex;
    align-items: center;
    gap: 5px;
}
.rah-bot-header-text span::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    display: inline-block;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25);
}
 
.rah-bot-header-close {
    position: relative;
    z-index: 1;
    margin-left: auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.14);
    color: var(--bot-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease;
}
.rah-bot-header-close:hover { background: rgba(255,255,255,0.26); }
.rah-bot-header-close svg { width: 14px; height: 14px; }
 
/* ---------- Message area ---------- */
.rah-bot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    background: var(--bot-sand);
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: #d3ccb9 transparent;
}
.rah-bot-messages::-webkit-scrollbar { width: 5px; }
.rah-bot-messages::-webkit-scrollbar-track { background: transparent; }
.rah-bot-messages::-webkit-scrollbar-thumb { background: #d3ccb9; border-radius: 10px; }
 
.rah-bot-row {
    display: flex;
    align-items: flex-end;
    gap: 7px;
    max-width: 88%;
    animation: rahBotIn 0.2s ease;
}
.rah-bot-row.bot { align-self: flex-start; }
.rah-bot-row.user { align-self: flex-end; flex-direction: row-reverse; }
@keyframes rahBotIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
 
.rah-bot-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    margin-bottom: 2px;
    box-shadow: 0 0 0 1px #e7e1d2;
}
 
.rah-bot-msg {
    padding: 10px 13px;
    border-radius: 15px;
    font-size: 13.5px;
    line-height: 1.55;
}
.rah-bot-msg.bot {
    background: var(--bot-white);
    color: var(--bot-ink);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 6px rgba(15, 60, 55, 0.07);
}
.rah-bot-msg.user {
    background: var(--bot-teal);
    color: var(--bot-white);
    border-bottom-right-radius: 4px;
}
.rah-bot-msg a {
    color: var(--bot-teal);
    font-weight: 600;
    text-decoration: underline;
}
.rah-bot-msg.user a { color: var(--bot-white); }
 
.rah-bot-msg-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 9px;
}
.rah-bot-msg-links a.rah-bot-link-btn {
    background: var(--bot-teal);
    color: var(--bot-white) !important;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    text-decoration: none !important;
    display: inline-block;
    transition: background 0.15s ease, transform 0.15s ease;
}
.rah-bot-msg-links a.rah-bot-link-btn:hover { background: var(--bot-teal-dark); transform: translateY(-1px); }
 
/* ---------- Quick replies ---------- */
.rah-bot-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 2px 14px 14px;
    background: var(--bot-sand);
    flex-shrink: 0;
}
.rah-bot-chip {
    background: var(--bot-white);
    border: 1px solid #ddd6c5;
    color: var(--bot-teal-dark);
    font-size: 12.5px;
    font-weight: 600;
    padding: 7px 13px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    font-family: 'Inter', sans-serif;
}
.rah-bot-chip:hover {
    background: var(--bot-teal);
    color: var(--bot-white);
    border-color: var(--bot-teal);
    transform: translateY(-1px);
}
.rah-bot-chip:active { transform: translateY(0); }
 
/* ---------- Input row ---------- */
.rah-bot-inputrow {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--bot-white);
    border-top: 1px solid #eee;
    flex-shrink: 0;
}
.rah-bot-inputrow input {
    flex: 1;
    border: 1.5px solid #e4e0d4;
    background: var(--bot-sand);
    border-radius: 22px;
    padding: 10px 16px;
    font-size: 13.5px;
    font-family: 'Inter', sans-serif;
    outline: none;
    color: var(--bot-ink);
    transition: border-color 0.15s ease, background 0.15s ease;
}
.rah-bot-inputrow input::placeholder { color: var(--bot-ink-soft); }
.rah-bot-inputrow input:focus { border-color: var(--bot-teal); background: var(--bot-white); }
.rah-bot-inputrow button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bot-teal);
    border: none;
    color: var(--bot-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, transform 0.15s ease;
}
.rah-bot-inputrow button:hover { background: var(--bot-teal-dark); transform: scale(1.05); }
.rah-bot-inputrow button:active { transform: scale(0.94); }
.rah-bot-inputrow button svg { width: 16px; height: 16px; margin-left: 1px; }
 
.rah-bot-typing-row { display: flex; align-items: flex-end; gap: 7px; }
 
.rah-bot-typing {
    display: flex;
    gap: 4px;
    padding: 13px 15px;
    background: var(--bot-white);
    border-radius: 15px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    box-shadow: 0 2px 6px rgba(15, 60, 55, 0.07);
}
.rah-bot-typing span {
    width: 6px;
    height: 6px;
    background: #b9b2a0;
    border-radius: 50%;
    animation: rahBotBounce 1.1s infinite ease-in-out;
}
.rah-bot-typing span:nth-child(2) { animation-delay: 0.15s; }
.rah-bot-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes rahBotBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-4px); opacity: 1; }
}
 
@media (max-width: 480px) {
    .rah-bot-panel {
        right: 16px;
        left: 16px;
        width: auto;
        bottom: 154px;
    }
    /* .rah-bot-toggle { right: 26px; } */
}
 
@media (prefers-reduced-motion: reduce) {
    .rah-bot-panel, .rah-bot-row, .rah-bot-toggle, .rah-bot-toggle.rah-bot-pulse::before { animation: none !important; transition: none !important; }
}