/* EBS AI Chat Concierge — Frontend Styles v1.0 */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@300;400;500&family=Jost:wght@300;400;500&display=swap');

.ebs-chat-container,
.ebs-bubble-wrap {
    --ebs-brand: #5a3e2b;
    --ebs-accent: #f5ede3;
    --ebs-radius: 12px;
    --ebs-font-body: 'Jost', sans-serif;
    --ebs-font-serif: 'Cormorant Garamond', serif;
    font-family: var(--ebs-font-body);
    box-sizing: border-box;
}

/* ── Floating bubble ─────────────────────────────── */
.ebs-bubble-wrap {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 99999;
}

.ebs-bubble-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px 12px 14px;
    background: var(--ebs-brand);
    color: var(--ebs-accent);
    border: none;
    border-radius: 999px;
    font-family: var(--ebs-font-body);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.04em;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0,0,0,0.22);
    transition: transform 0.15s, box-shadow 0.15s;
}
.ebs-bubble-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,0.28); }
.ebs-bubble-btn svg { width: 18px; height: 18px; stroke: var(--ebs-accent); fill: none; flex-shrink: 0; }

.ebs-chat-container.ebs-floating {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 380px;
    border-radius: var(--ebs-radius);
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    animation: ebsFadeUp 0.2s ease;
}

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

/* ── Inline ─────────────────────────────────────── */
.ebs-chat-container.ebs-inline {
    max-width: 560px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: var(--ebs-radius);
    overflow: hidden;
}

/* ── Toggle bar ─────────────────────────────────── */
.ebs-toggle-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(0,0,0,0.07);
}
.ebs-toggle-title {
    display: block;
    font-family: var(--ebs-font-serif);
    font-size: 15px;
    font-weight: 400;
    color: #1a1a1a;
    letter-spacing: 0.03em;
}
.ebs-toggle-sub {
    display: block;
    font-size: 11.5px;
    color: #888;
    margin-top: 1px;
}
.ebs-pill {
    display: flex;
    margin-left: auto;
    border: 1px solid rgba(90,62,43,0.35);
    border-radius: 999px;
    overflow: hidden;
    flex-shrink: 0;
}
.ebs-pill-btn {
    padding: 5px 13px;
    font-size: 12px;
    font-family: var(--ebs-font-body);
    font-weight: 400;
    border: none;
    background: none;
    cursor: pointer;
    color: #777;
    letter-spacing: 0.04em;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.ebs-pill-btn.active { background: var(--ebs-brand); color: var(--ebs-accent); }
.ebs-close-btn {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    font-size: 16px;
    line-height: 1;
    padding: 2px 4px;
}

/* ── Chat header ─────────────────────────────────── */
.ebs-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--ebs-brand);
}
.ebs-hdr-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ebs-hdr-avatar svg { width: 16px; height: 16px; fill: var(--ebs-accent); }
.ebs-hdr-name { font-family: var(--ebs-font-serif); font-size: 14px; font-weight: 400; color: var(--ebs-accent); letter-spacing: 0.04em; }
.ebs-hdr-sub  { font-size: 11px; color: rgba(245,237,227,0.65); margin-top: 1px; }
.ebs-online-dot { width: 8px; height: 8px; border-radius: 50%; background: #8ec98e; margin-left: auto; flex-shrink: 0; }

/* ── Messages ─────────────────────────────────────── */
.ebs-messages {
    height: 300px;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    scroll-behavior: smooth;
}
.ebs-messages::-webkit-scrollbar { width: 3px; }
.ebs-messages::-webkit-scrollbar-thumb { background: rgba(90,62,43,0.18); border-radius: 3px; }

.ebs-msg { display: flex; gap: 7px; max-width: 90%; }
.ebs-msg.ebs-user { align-self: flex-end; flex-direction: row-reverse; }
.ebs-bubble {
    padding: 8px 13px;
    font-size: 13.5px;
    line-height: 1.55;
    border-radius: 12px;
}
.ebs-msg.ebs-ai .ebs-bubble {
    background: #f4f0eb;
    color: #2a1f16;
    border-radius: 3px 12px 12px 12px;
}
.ebs-msg.ebs-user .ebs-bubble {
    background: var(--ebs-brand);
    color: var(--ebs-accent);
    border-radius: 12px 3px 12px 12px;
}
.ebs-msg-icon {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: var(--ebs-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}
.ebs-msg-icon svg { width: 12px; height: 12px; fill: var(--ebs-accent); }

.ebs-typing {
    display: inline-flex;
    gap: 4px;
    padding: 8px 13px;
    background: #f4f0eb;
    border-radius: 3px 12px 12px 12px;
}
.ebs-typing span {
    width: 5px; height: 5px; border-radius: 50%; background: #888;
    animation: ebsDot 1.2s infinite;
}
.ebs-typing span:nth-child(2) { animation-delay: 0.2s; }
.ebs-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ebsDot {
    0%,60%,100% { opacity: 0.25; transform: scale(1); }
    30%          { opacity: 1;    transform: scale(1.25); }
}

/* ── Quick replies ───────────────────────────────── */
.ebs-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 14px 10px;
    min-height: 8px;
}
.ebs-qr-btn {
    padding: 4px 12px;
    background: none;
    border: 1px solid var(--ebs-brand);
    border-radius: 999px;
    font-size: 12px;
    font-family: var(--ebs-font-body);
    color: var(--ebs-brand);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    letter-spacing: 0.03em;
}
.ebs-qr-btn:hover { background: var(--ebs-brand); color: var(--ebs-accent); }

/* ── Input row ───────────────────────────────────── */
.ebs-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid rgba(0,0,0,0.07);
}
.ebs-text-input {
    flex: 1;
    border: 1px solid rgba(90,62,43,0.25);
    border-radius: 999px;
    padding: 8px 15px;
    font-size: 13.5px;
    font-family: var(--ebs-font-body);
    color: #1a1a1a;
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
}
.ebs-text-input:focus { border-color: var(--ebs-brand); }
.ebs-send-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--ebs-brand);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.2s;
}
.ebs-send-btn:hover { opacity: 0.82; }
.ebs-send-btn svg { width: 14px; height: 14px; fill: var(--ebs-accent); }

/* ── Summary screen ──────────────────────────────── */
.ebs-sum-header {
    padding: 14px 18px;
    background: var(--ebs-brand);
    font-family: var(--ebs-font-serif);
    font-size: 15px;
    font-weight: 400;
    color: var(--ebs-accent);
    letter-spacing: 0.04em;
}
.ebs-sum-body {
    padding: 12px 18px;
    max-height: 260px;
    overflow-y: auto;
}
.ebs-sum-row {
    display: flex;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    font-size: 13px;
}
.ebs-sum-row:last-child { border-bottom: none; }
.ebs-sum-key { font-weight: 500; color: #666; min-width: 110px; flex-shrink: 0; }
.ebs-sum-val { color: #1a1a1a; }
.ebs-sum-actions {
    display: flex;
    gap: 8px;
    padding: 10px 18px;
}
.ebs-sum-edit {
    padding: 9px 14px;
    background: none;
    border: 1px solid var(--ebs-brand);
    border-radius: 7px;
    font-family: var(--ebs-font-body);
    font-size: 13px;
    color: var(--ebs-brand);
    cursor: pointer;
}
.ebs-sum-confirm {
    flex: 1;
    padding: 9px 14px;
    background: var(--ebs-brand);
    border: none;
    border-radius: 7px;
    font-family: var(--ebs-font-body);
    font-size: 13px;
    color: var(--ebs-accent);
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: opacity 0.2s;
}
.ebs-sum-confirm:hover { opacity: 0.85; }
.ebs-sum-confirm:disabled { opacity: 0.5; cursor: not-allowed; }
.ebs-sum-status {
    padding: 4px 18px 12px;
    font-size: 12px;
    color: #666;
    min-height: 20px;
    text-align: center;
}
.ebs-sum-status.success { color: #2d6a2d; }
.ebs-sum-status.error   { color: #a32d2d; }

/* ── Success screen ──────────────────────────────── */
.ebs-screen-success {
    padding: 36px 24px;
    text-align: center;
}
.ebs-success-icon {
    font-size: 36px;
    color: var(--ebs-brand);
    margin-bottom: 14px;
}
.ebs-success-msg {
    font-family: var(--ebs-font-serif);
    font-size: 18px;
    font-weight: 400;
    color: #2a1f16;
    line-height: 1.6;
    margin: 0;
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 480px) {
    .ebs-chat-container.ebs-floating { width: calc(100vw - 24px); right: 12px; }
    .ebs-bubble-wrap { bottom: 16px; right: 16px; }
    .ebs-toggle-bar { flex-wrap: wrap; }
    .ebs-pill { margin-left: 0; }
}
