/* =============================================================
   Enterprise DB Chatbot – Corporate Design System
   v2.0 – Sin degradados · Tipografía Inter · UX empresarial
   ============================================================= */

/* ── Shell ──────────────────────────────────────────────────── */
.edbc-floating-shell {
    --edbc-primary:     #0d1b2a;
    --edbc-accent:      #c89b3c;
    --edbc-surface:     #ffffff;
    --edbc-border:      #d4d6db;
    --edbc-text:        #0d1b2a;
    --edbc-text-muted:  #6b7280;
    --edbc-panel-width: 380px;
    --edbc-radius:      4px;
    --edbc-t:           0.22s cubic-bezier(0.4, 0, 0.2, 1);

    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    position: fixed !important;
    right: 28px !important;
    bottom: 28px !important;
    z-index: 999999 !important;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

/* ── Launcher Button ────────────────────────────────────────── */
.edbc-launcher {
    align-items: center;
    background: var(--edbc-primary);
    border: none;
    border-radius: var(--edbc-radius);
    box-shadow: 0 4px 18px rgba(13, 27, 42, 0.35);
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    gap: 10px;
    padding: 14px 20px;
    transition: background var(--edbc-t), box-shadow var(--edbc-t), transform var(--edbc-t);
    white-space: nowrap;
}

.edbc-launcher:hover {
    background: #162c42;
    box-shadow: 0 6px 24px rgba(13, 27, 42, 0.45);
    transform: translateY(-1px);
}

.edbc-launcher:active {
    transform: translateY(0);
}

.edbc-launcher-core {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    position: relative;
}

/* Notification dot */
.edbc-launcher-pulse {
    background: var(--edbc-accent);
    border-radius: 50%;
    height: 8px;
    position: absolute;
    right: -4px;
    top: -4px;
    width: 8px;
}

.edbc-launcher-icon {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.edbc-launcher-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ── Chat Panel ─────────────────────────────────────────────── */
.edbc-chatbot-card {
    background: var(--edbc-surface);
    border: 1px solid var(--edbc-border);
    border-radius: var(--edbc-radius);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.07),
        0 20px 60px -10px rgba(13, 27, 42, 0.2);
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(10px);
    transform-origin: bottom right;
    transition: opacity var(--edbc-t), transform var(--edbc-t);
    width: min(calc(100vw - 56px), var(--edbc-panel-width));
}

.edbc-chatbot-card.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* ── Header ─────────────────────────────────────────────────── */
.edbc-chatbot-header {
    align-items: center;
    background: var(--edbc-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    padding: 18px 20px;
}

.edbc-chatbot-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.edbc-chatbot-kicker {
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    margin: 0;
    text-transform: uppercase;
}

.edbc-chatbot-header h3 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0;
}

.edbc-chatbot-header-actions {
    align-items: center;
    display: flex;
    gap: 8px;
}

.edbc-chatbot-badge {
    background: rgba(200, 155, 60, 0.15);
    border: 1px solid rgba(200, 155, 60, 0.35);
    border-radius: var(--edbc-radius);
    color: var(--edbc-accent);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 4px 8px;
    text-transform: uppercase;
}

.edbc-close-button {
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--edbc-radius);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: inline-flex;
    font-size: 18px;
    height: 30px;
    justify-content: center;
    line-height: 1;
    transition: background var(--edbc-t), color var(--edbc-t);
    width: 30px;
}

.edbc-close-button:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

/* ── Messages Area ──────────────────────────────────────────── */
.edbc-chatbot-messages {
    background: #f9fafb;
    border-bottom: 1px solid var(--edbc-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 380px;
    min-height: 220px;
    overflow-y: auto;
    padding: 20px;
    scroll-behavior: smooth;
}

.edbc-chatbot-messages::-webkit-scrollbar {
    width: 4px;
}

.edbc-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.edbc-chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--edbc-border);
    border-radius: 2px;
}

.edbc-message {
    display: flex;
}

.edbc-message-bot  { justify-content: flex-start; }
.edbc-message-user { justify-content: flex-end; }

.edbc-message-bubble {
    font-size: 13.5px;
    line-height: 1.65;
    max-width: 86%;
    padding: 10px 14px;
    word-break: break-word;
}

.edbc-message-bubble p {
    margin: 0 0 9px;
}

.edbc-message-bubble p:last-child {
    margin-bottom: 0;
}

.edbc-message-bubble strong {
    color: var(--edbc-primary);
    font-weight: 800;
}

.edbc-message-bubble a {
    color: var(--edbc-accent);
    font-weight: 700;
    text-decoration: none;
}

.edbc-message-bubble a:hover {
    text-decoration: underline;
}

.edbc-response-list {
    display: grid;
    gap: 7px;
    list-style: none;
    margin: 8px 0;
    padding: 0;
}

.edbc-response-list li {
    background: rgba(200, 155, 60, 0.1);
    border-left: 3px solid var(--edbc-accent);
    border-radius: 10px;
    padding: 8px 10px;
}

.edbc-message-bot .edbc-message-bubble {
    background: #ffffff;
    border: 1px solid var(--edbc-border);
    border-radius: 0 var(--edbc-radius) var(--edbc-radius) var(--edbc-radius);
    color: var(--edbc-text);
}

.edbc-message-user .edbc-message-bubble {
    background: var(--edbc-primary);
    border-radius: var(--edbc-radius) 0 var(--edbc-radius) var(--edbc-radius);
    color: #ffffff;
}

/* ── Input Form ─────────────────────────────────────────────── */
.edbc-chatbot-form {
    align-items: flex-end;
    background: #ffffff;
    display: flex;
    gap: 10px;
    padding: 14px 16px;
}

.edbc-chatbot-input {
    background: #f9fafb;
    border: 1px solid var(--edbc-border);
    border-radius: var(--edbc-radius);
    color: var(--edbc-text);
    flex: 1;
    font: inherit;
    min-height: 42px;
    padding: 10px 13px;
    resize: none;
    transition: border-color var(--edbc-t), box-shadow var(--edbc-t);
}

.edbc-chatbot-input::placeholder {
    color: var(--edbc-text-muted);
}

.edbc-chatbot-input:focus {
    background: #ffffff;
    border-color: var(--edbc-primary);
    box-shadow: 0 0 0 3px rgba(13, 27, 42, 0.09);
    outline: none;
}

.edbc-chatbot-submit {
    align-items: center;
    background: var(--edbc-primary);
    border: none;
    border-radius: var(--edbc-radius);
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    flex-shrink: 0;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    height: 42px;
    justify-content: center;
    letter-spacing: 0.06em;
    padding: 0 18px;
    text-transform: uppercase;
    transition: background var(--edbc-t), box-shadow var(--edbc-t);
}

.edbc-chatbot-submit:hover:not(:disabled) {
    background: #162c42;
    box-shadow: 0 2px 8px rgba(13, 27, 42, 0.25);
}

.edbc-chatbot-submit:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* ── Footer Branding ────────────────────────────────────────── */
.edbc-chatbot-footer {
    background: #ffffff;
    border-top: 1px solid var(--edbc-border);
    color: var(--edbc-text-muted);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.06em;
    padding: 8px 16px;
    text-align: center;
    text-transform: uppercase;
}

/* ── Typing Indicator ───────────────────────────────────────── */
.edbc-typing {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.edbc-typing span {
    animation: edbcDot 1.2s infinite;
    background: #9ca3af;
    border-radius: 50%;
    display: block;
    height: 6px;
    width: 6px;
}

.edbc-typing span:nth-child(2) { animation-delay: 0.2s; }
.edbc-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes edbcDot {
    0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
    40%            { opacity: 1;    transform: scale(1); }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
    .edbc-floating-shell {
        bottom: 16px;
        left: 16px;
        right: 16px;
    }

    .edbc-chatbot-card {
        width: 100%;
    }

    .edbc-launcher-label {
        display: none;
    }

    .edbc-chatbot-form {
        flex-direction: column;
    }

    .edbc-chatbot-submit {
        height: 44px;
        width: 100%;
    }
}
