/* DigiSEO floating chatbot */
.digiseo-chatbot-root {
    --gcb-primary: #2e3192;
    --gcb-accent: #b8217a;
    --gcb-panel-w: min(400px, calc(100vw - 32px));
    --gcb-panel-h: min(560px, calc(100vh - 100px));
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 10050;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    pointer-events: none;
}

.digiseo-chatbot-root * {
    box-sizing: border-box;
}

.digiseo-chatbot-root > * {
    pointer-events: auto;
}

.digiseo-chatbot-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-left: auto;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: transparent;
    box-shadow: 0 8px 28px rgba(46, 49, 146, 0.45);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    overflow: hidden;
}

.digiseo-chatbot-fab img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    display: block;
}

.digiseo-chatbot-fab:hover {
    transform: scale(1.06);
    box-shadow: 0 10px 32px rgba(46, 49, 146, 0.55);
}

.digiseo-chatbot-fab:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 3px;
}

.digiseo-chatbot-root.is-open .digiseo-chatbot-fab {
    display: none;
}

.digiseo-chatbot-panel {
    display: none;
    flex-direction: column;
    width: var(--gcb-panel-w);
    height: var(--gcb-panel-h);
    margin-bottom: 12px;
    border-radius: 18px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28);
    border: 1px solid #e2e8f0;
}

.digiseo-chatbot-root.is-open .digiseo-chatbot-panel {
    display: flex;
}

.digiseo-chatbot-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(135deg, var(--gcb-primary) 0%, #4f46e5 55%, var(--gcb-accent) 100%);
    color: #fff;
}

.digiseo-chatbot-avatar {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.85);
    background: #fff;
}

.digiseo-chatbot-head-text {
    flex: 1;
    min-width: 0;
}

.digiseo-chatbot-head-text strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
}

.digiseo-chatbot-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    opacity: 0.95;
}

.digiseo-chatbot-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.35);
}

.digiseo-chatbot-close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.digiseo-chatbot-close:hover {
    background: rgba(255, 255, 255, 0.28);
}

.digiseo-chatbot-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 14px;
    background: #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.digiseo-chatbot-msg-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    max-width: 100%;
}

.digiseo-chatbot-msg-row--user {
    flex-direction: row-reverse;
}

.digiseo-chatbot-msg-row .digiseo-chatbot-msg-ico {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.digiseo-chatbot-msg {
    max-width: calc(100% - 36px);
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 0.875rem;
    line-height: 1.45;
    word-break: break-word;
    white-space: pre-wrap;
}

.digiseo-chatbot-msg--bot {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    border-bottom-left-radius: 4px;
}

.digiseo-chatbot-msg--user {
    background: linear-gradient(135deg, var(--gcb-primary), #4f46e5);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.digiseo-chatbot-msg--typing {
    opacity: 0.75;
    font-style: italic;
}

.digiseo-chatbot-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px 4px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    max-height: 110px;
    overflow-y: auto;
}

.digiseo-chatbot-quick-btn {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.25;
    text-align: left;
}

.digiseo-chatbot-quick-btn:hover {
    border-color: var(--gcb-primary);
    color: var(--gcb-primary);
    background: #eef2ff;
}

.digiseo-chatbot-quick-btn--pricing {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 700;
}

.digiseo-chatbot-quick-btn--pricing:hover {
    border-color: #1d4ed8;
    background: #dbeafe;
    color: #1e3a8a;
}

.digiseo-chatbot-foot {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.digiseo-chatbot-input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 0.875rem;
    font-family: inherit;
    resize: none;
    max-height: 88px;
    line-height: 1.35;
}

.digiseo-chatbot-input:focus {
    outline: none;
    border-color: var(--gcb-primary);
    box-shadow: 0 0 0 2px rgba(46, 49, 146, 0.2);
}

.digiseo-chatbot-send {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 10px;
    background: var(--gcb-primary);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.digiseo-chatbot-send:hover:not(:disabled) {
    background: #1e2478;
}

.digiseo-chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.digiseo-chatbot-send svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 480px) {
    .digiseo-chatbot-root {
        right: 12px;
        bottom: 12px;
    }
    .digiseo-chatbot-quick {
        max-height: 88px;
    }
}
