/* ============================================================
   Samanvi Website Planner – Chat Widget
   Brand: Navy #1f4e8a | Teal #18a590
   ============================================================ */

:root {
    --smcb-navy:    #1f4e8a;
    --smcb-teal:    #18a590;
    --smcb-teal-dk: #138a78;
    --smcb-white:   #ffffff;
    --smcb-bg:      #f4f7fb;
    --smcb-border:  #e2e8f0;
    --smcb-text:    #2d3748;
    --smcb-muted:   #718096;
    --smcb-shadow:  0 8px 32px rgba(31,78,138,.18);
    --smcb-radius:  16px;
    --smcb-z:       99999;
}

/* ── Floating bubble ──────────────────────────────────────── */

#smcb-floating-root {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: var(--smcb-z);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.smcb-bubble {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--smcb-navy);
    color: var(--smcb-white);
    border: none;
    border-radius: 50px;
    padding: 14px 22px 14px 18px;
    cursor: pointer;
    box-shadow: var(--smcb-shadow);
    font-size: 15px;
    font-weight: 600;
    transition: background .2s, transform .15s;
    white-space: nowrap;
}

.smcb-bubble:hover {
    background: var(--smcb-teal);
    transform: translateY(-2px);
}

.smcb-bubble i {
    font-size: 18px;
}

.smcb-bubble-label {
    font-size: 14px;
}

/* ── Chat window ──────────────────────────────────────────── */

.smcb-window {
    position: fixed;
    bottom: 100px;
    right: 28px;
    width: 380px;
    height: 560px;
    background: var(--smcb-white);
    border-radius: var(--smcb-radius);
    box-shadow: var(--smcb-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: var(--smcb-z);
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px) scale(.97);
    transition: opacity .22s ease, transform .22s ease;
}

.smcb-window--open {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0) scale(1);
}

/* Inline (shortcode) mode */
#smcb-shortcode-root .smcb-window {
    position: relative;
    bottom: auto;
    right: auto;
    width: 100%;
    max-width: 480px;
    height: 580px;
    margin: 20px auto;
    opacity: 1;
    pointer-events: all;
    transform: none;
}

/* ── Header ───────────────────────────────────────────────── */

.smcb-header {
    background: var(--smcb-navy);
    color: var(--smcb-white);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.smcb-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.smcb-avatar {
    width: 36px;
    height: 36px;
    background: var(--smcb-teal);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.smcb-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.smcb-subtitle {
    font-size: 12px;
    opacity: .75;
}

.smcb-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.7);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 16px;
    transition: color .15s;
}
.smcb-close:hover { color: var(--smcb-white); }

/* ── Progress bar ─────────────────────────────────────────── */

.smcb-progress {
    height: 3px;
    background: rgba(255,255,255,.15);
    flex-shrink: 0;
}

.smcb-progress-bar {
    height: 100%;
    background: var(--smcb-teal);
    width: 0%;
    transition: width .4s ease;
}

/* ── Messages ─────────────────────────────────────────────── */

.smcb-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--smcb-bg);
}

.smcb-messages::-webkit-scrollbar {
    width: 4px;
}
.smcb-messages::-webkit-scrollbar-track { background: transparent; }
.smcb-messages::-webkit-scrollbar-thumb { background: var(--smcb-border); border-radius: 4px; }

/* Message bubble */
.smcb-msg {
    max-width: 82%;
    line-height: 1.5;
    font-size: 14px;
    animation: smcbFadeUp .25s ease forwards;
}

.smcb-msg--bot {
    align-self: flex-start;
}

.smcb-msg--user {
    align-self: flex-end;
}

.smcb-msg-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    word-break: break-word;
}

.smcb-msg--bot .smcb-msg-bubble {
    background: var(--smcb-white);
    color: var(--smcb-text);
    border-radius: 4px 14px 14px 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,.07);
}

.smcb-msg--user .smcb-msg-bubble {
    background: var(--smcb-teal);
    color: var(--smcb-white);
    border-radius: 14px 4px 14px 14px;
}

/* Typing indicator */
.smcb-typing .smcb-msg-bubble {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 12px 16px;
}

.smcb-dot {
    width: 7px;
    height: 7px;
    background: var(--smcb-muted);
    border-radius: 50%;
    animation: smcbBounce 1.2s infinite;
}
.smcb-dot:nth-child(2) { animation-delay: .2s; }
.smcb-dot:nth-child(3) { animation-delay: .4s; }

/* ── Input area ───────────────────────────────────────────── */

.smcb-input-area {
    background: var(--smcb-white);
    border-top: 1px solid var(--smcb-border);
    padding: 12px;
    flex-shrink: 0;
}

/* Choice buttons */
.smcb-choices-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 10px;
}

.smcb-choices-wrapper:empty {
    display: none;
    margin: 0;
}

.smcb-choice-btn {
    padding: 7px 14px;
    border: 1.5px solid var(--smcb-navy);
    background: var(--smcb-white);
    color: var(--smcb-navy);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    line-height: 1.3;
}

.smcb-choice-btn:hover,
.smcb-choice-btn.smcb-selected {
    background: var(--smcb-navy);
    color: var(--smcb-white);
}

/* Multi-choice "Continue" button */
.smcb-multi-continue {
    margin-top: 4px;
    width: 100%;
    padding: 8px;
    background: var(--smcb-teal);
    color: var(--smcb-white);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.smcb-multi-continue:hover { background: var(--smcb-teal-dk); }

/* Text input row */
.smcb-text-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.smcb-text-input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--smcb-border);
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color .15s;
    color: var(--smcb-text);
}

.smcb-text-input:focus {
    border-color: var(--smcb-teal);
}

.smcb-send-btn {
    width: 40px;
    height: 40px;
    background: var(--smcb-teal);
    color: var(--smcb-white);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    flex-shrink: 0;
    transition: background .15s, transform .1s;
}

.smcb-send-btn:hover {
    background: var(--smcb-teal-dk);
    transform: scale(1.05);
}

.smcb-send-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ── Completion card ──────────────────────────────────────── */

.smcb-complete-card {
    background: linear-gradient(135deg, var(--smcb-navy), var(--smcb-teal));
    color: var(--smcb-white);
    border-radius: 12px;
    padding: 16px;
    margin: 4px 0;
    text-align: center;
}

.smcb-complete-card h4 {
    margin: 0 0 6px;
    font-size: 16px;
}

.smcb-complete-card p {
    margin: 0;
    font-size: 13px;
    opacity: .85;
}

/* ── Animations ───────────────────────────────────────────── */

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

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

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 480px) {
    .smcb-window,
    #smcb-floating-root .smcb-window {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 90px;
        height: 75vh;
        max-height: 560px;
    }

    .smcb-bubble-label {
        display: none;
    }

    .smcb-bubble {
        padding: 14px;
        border-radius: 50%;
        width: 52px;
        height: 52px;
        justify-content: center;
    }
}
