/* ════════════════════════════════════════
   SmartTent Chatbot — chatbot.css
   Smarthost.gr
════════════════════════════════════════ */

:root {
    --stc-primary:   #e8560a;
    --stc-primary-d: #c94508;
    --stc-bg:        #f6f7fb;
    --stc-white:     #ffffff;
    --stc-text:      #1a1a2e;
    --stc-muted:     #6b7280;
    --stc-radius:    18px;
    --stc-shadow:    0 8px 40px rgba(0,0,0,.18);
}

/* ── FAB (Floating Action Button) ─────── */
#stcbot-fab {
    position: fixed;
    z-index: 99997;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 26px;
    line-height: 60px;
    text-align: center;
    background: var(--stc-primary);
    color: #fff;
    box-shadow: 0 4px 20px rgba(232,86,10,.45);
    transition: transform .2s, box-shadow .2s;
    outline: none;
}
#stcbot-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(232,86,10,.55);
}
#stcbot-fab.stc-pos-bottom-right { bottom: 22px; right: 22px; }
#stcbot-fab.stc-pos-bottom-left  { bottom: 22px; left:  22px; }

/* pulse ring */
#stcbot-fab::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid var(--stc-primary);
    opacity: .3;
    animation: stc-pulse 2.2s infinite;
}
@keyframes stc-pulse {
    0%   { transform: scale(1);   opacity: .35; }
    70%  { transform: scale(1.35); opacity: 0; }
    100% { transform: scale(1);   opacity: 0; }
}
#stcbot-fab.stc-open::after { animation: none; }

/* ── Chat window ──────────────────────── */
#stcbot-window {
    position: fixed;
    z-index: 99998;
    width: 400px;
    max-height: 680px;
    border-radius: var(--stc-radius);
    box-shadow: var(--stc-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--stc-white);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    transition: opacity .22s ease, transform .22s ease;
}
#stcbot-window.stc-pos-bottom-right { bottom: 96px; right: 22px; }
#stcbot-window.stc-pos-bottom-left  { bottom: 96px; left:  22px; }
#stcbot-window.stc-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(14px) scale(.97);
}

/* ── Inline variant ───────────────────── */
#stcbot-inline-root .stc-chat-box {
    width: 100%;
    max-width: 480px;
    max-height: 680px;
    border-radius: var(--stc-radius);
    box-shadow: var(--stc-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--stc-white);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ── Header ───────────────────────────── */
.stc-header {
    background: var(--stc-primary);
    padding: 13px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    color: #fff;
}
.stc-header-logo {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    overflow: hidden;
}
.stc-header-logo img { width: 34px; height: 34px; object-fit: cover; border-radius: 50%; }
.stc-header-info { flex: 1; line-height: 1.25; }
.stc-header-name { font-weight: 700; font-size: 14px; }
.stc-header-status { font-size: 11.5px; opacity: .85; display: flex; align-items: center; gap: 4px; }
.stc-online-dot { width: 7px; height: 7px; background: #4ade80; border-radius: 50%; display: inline-block; }
.stc-header-actions { display: flex; align-items: center; gap: 6px; }
.stc-reset-header-btn {
    background: rgba(255,255,255,.18);
    border: none;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    padding: 5px 7px;
    border-radius: 7px;
    line-height: 1;
    transition: background .15s;
    display: flex; align-items: center; justify-content: center;
}
.stc-reset-header-btn:hover { background: rgba(255,255,255,.32); }
.stc-close-btn {
    background: rgba(255,255,255,.18);
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    padding: 5px 7px;
    border-radius: 7px;
    line-height: 1;
    transition: background .15s;
}
.stc-close-btn:hover { background: rgba(255,255,255,.32); }

/* ── Messages ─────────────────────────── */
.stc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--stc-bg);
    scroll-behavior: smooth;
}
.stc-messages::-webkit-scrollbar { width: 4px; }
.stc-messages::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

/* bubbles */
.stc-bubble {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.55;
    word-break: break-word;
    white-space: pre-line;
}
.stc-bubble-bot {
    background: var(--stc-white);
    color: var(--stc-text);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    align-self: flex-start;
}
.stc-bubble-user {
    background: var(--stc-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

/* ── Options panel ────────────────────── */
.stc-options {
    padding: 8px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
    background: var(--stc-bg);
    border-top: 1px solid #e5e7eb;
    overflow: visible;
}

.stc-opt-btn {
    width: 100%;
    text-align: left;
    background: var(--stc-white);
    border: 1.5px solid #e2e5ed;
    border-radius: 10px;
    padding: 9px 13px;
    font-size: 13.5px;
    cursor: pointer;
    color: var(--stc-text);
    transition: border-color .14s, background .14s, transform .1s;
    line-height: 1.4;
    outline: none;
}
.stc-opt-btn:hover {
    border-color: var(--stc-primary);
    background: #fff5f0;
    transform: translateX(3px);
}
.stc-opt-btn:active { transform: translateX(1px); }

/* ── Lead form ────────────────────────── */
.stc-lead-form {
    padding: 12px 14px 16px;
    background: var(--stc-bg);
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}
.stc-lead-form input,
.stc-lead-form textarea {
    width: 100%;
    border: 1.5px solid #dde1ea;
    border-radius: 9px;
    padding: 9px 12px;
    font-size: 13.5px;
    font-family: inherit;
    background: #fff;
    color: var(--stc-text);
    box-sizing: border-box;
    transition: border-color .14s;
    outline: none;
}
.stc-lead-form input:focus,
.stc-lead-form textarea:focus { border-color: var(--stc-primary); }
.stc-lead-form textarea { resize: vertical; min-height: 56px; }

.stc-submit-btn {
    width: 100%;
    padding: 11px;
    background: var(--stc-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .1s;
    letter-spacing: .3px;
    position: sticky;
    bottom: 0;
    z-index: 1;
    box-shadow: 0 -4px 12px rgba(0,0,0,.08);
}
.stc-submit-btn:hover   { background: var(--stc-primary-d); }
.stc-submit-btn:active  { transform: scale(.98); }
.stc-submit-btn:disabled { opacity: .6; cursor: default; }

.stc-field-error { border-color: #ef4444 !important; }
.stc-form-hint   { font-size: 11.5px; color: var(--stc-muted); text-align: center; }

/* ── Success message ──────────────────── */
.stc-success-msg {
    padding: 18px 16px;
    text-align: center;
    background: var(--stc-bg);
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}
.stc-success-msg .stc-success-icon { font-size: 36px; margin-bottom: 8px; display: block; }
.stc-success-msg p { font-size: 14px; color: #15803d; font-weight: 600; margin: 0 0 10px; }
.stc-restart-btn {
    background: none;
    border: 1.5px solid var(--stc-primary);
    color: var(--stc-primary);
    border-radius: 8px;
    padding: 7px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s;
}
.stc-restart-btn:hover { background: #fff5f0; }

/* ── Typing indicator ─────────────────── */
.stc-typing {
    display: flex; gap: 4px; align-items: center;
    padding: 4px 2px;
}
.stc-typing span {
    width: 7px; height: 7px;
    background: #c0c4cc; border-radius: 50%;
    animation: stc-bounce .85s infinite ease-in-out;
}
.stc-typing span:nth-child(2) { animation-delay: .14s; }
.stc-typing span:nth-child(3) { animation-delay: .28s; }
@keyframes stc-bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40%           { transform: translateY(-7px); }
}

/* ── Responsive ───────────────────────── */
@media (max-width: 450px) {
    #stcbot-window,
    #stcbot-window.stc-pos-bottom-right,
    #stcbot-window.stc-pos-bottom-left {
        width: calc(100vw - 20px);
        right: 10px !important;
        left:  10px !important;
        bottom: 90px;
    }
}
