/* ═══════════════════════════════════════════════════════
   NEUROSTRENGTH AI — CHATBOT WIDGET STYLES
   Design: Glassmorphism dark · Gold accent #f4c025
   ═══════════════════════════════════════════════════════ */

:root {
    --cb-primary: #f4c025;
    --cb-primary-dim: rgba(244, 192, 37, 0.15);
    --cb-primary-glow: rgba(244, 192, 37, 0.25);
    --cb-bg: rgba(10, 9, 4, 0.92);
    --cb-surface: rgba(26, 24, 16, 0.85);
    --cb-border: rgba(244, 192, 37, 0.15);
    --cb-border-hover: rgba(244, 192, 37, 0.35);
    --cb-text: #f1f5f9;
    --cb-text-muted: #94a3b8;
    --cb-radius: 1.25rem;
    --cb-radius-sm: 0.75rem;
    --cb-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 40px var(--cb-primary-glow);
    --cb-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Floating Container ─────────────────────── */
#chatbot-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    font-family: 'Plus Jakarta Sans', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
}

/* ── Toggle Button ─────────────────────────── */
#chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--cb-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px var(--cb-primary-glow), 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: var(--cb-transition);
    position: relative;
    flex-shrink: 0;
}

#chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(244, 192, 37, 0.45), 0 4px 15px rgba(0, 0, 0, 0.4);
}

#chatbot-toggle svg {
    width: 26px;
    height: 26px;
    color: #0a0904;
    transition: var(--cb-transition);
}

#chatbot-toggle .cb-icon-close {
    display: none;
}

#chatbot-toggle .cb-icon-chat {
    display: block;
}

#chatbot-widget.cb-open #chatbot-toggle .cb-icon-close {
    display: block;
}

#chatbot-widget.cb-open #chatbot-toggle .cb-icon-chat {
    display: none;
}

/* Notification badge */
#chatbot-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid #0a0904;
    font-size: 10px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: cb-badge-pulse 2s infinite;
}

@keyframes cb-badge-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

#chatbot-widget.cb-open #chatbot-badge {
    display: none;
}

/* ── Chat Panel ────────────────────────────── */
#chatbot-panel {
    width: 370px;
    height: 520px;
    background: var(--cb-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--cb-border);
    border-radius: var(--cb-radius);
    box-shadow: var(--cb-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;

    /* Animation */
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity var(--cb-transition), transform var(--cb-transition);
    transform-origin: bottom right;
}

#chatbot-widget.cb-open #chatbot-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* ── Header ────────────────────────────────── */
#chatbot-header {
    padding: 1rem 1.25rem;
    background: var(--cb-surface);
    border-bottom: 1px solid var(--cb-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.cb-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cb-primary), #e8a800);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    font-weight: 800;
    color: #0a0904;
}

.cb-header-info {
    flex: 1;
}

.cb-header-info h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--cb-text);
    margin: 0;
    letter-spacing: -0.01em;
}

.cb-status-line {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 2px;
}

.cb-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    animation: cb-pulse-green 2s infinite;
}

@keyframes cb-pulse-green {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.cb-status-text {
    font-size: 0.7rem;
    color: #22c55e;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.cb-header-logo {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--cb-primary);
    opacity: 0.7;
    text-align: right;
    line-height: 1.3;
}

/* ── Messages Area ─────────────────────────── */
#chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    scroll-behavior: smooth;
}

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

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

#chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--cb-border-hover);
    border-radius: 2px;
}

/* Message bubbles */
.cb-msg {
    max-width: 85%;
    padding: 0.625rem 0.875rem;
    border-radius: var(--cb-radius-sm);
    font-size: 0.825rem;
    line-height: 1.55;
    animation: cb-msg-in 0.25s ease forwards;
}

@keyframes cb-msg-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cb-msg-bot {
    background: var(--cb-surface);
    border: 1px solid var(--cb-border);
    color: var(--cb-text);
    align-self: flex-start;
    border-bottom-left-radius: 0.25rem;
}

.cb-msg-user {
    background: var(--cb-primary);
    color: #0a0904;
    font-weight: 600;
    align-self: flex-end;
    border-bottom-right-radius: 0.25rem;
}

/* Quick reply buttons */
.cb-quick-replies {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    align-self: flex-start;
    width: 100%;
    max-width: 90%;
    animation: cb-msg-in 0.3s ease 0.1s both;
}

.cb-quick-btn {
    padding: 0.55rem 1rem;
    background: transparent;
    border: 1px solid var(--cb-border-hover);
    border-radius: 9999px;
    color: var(--cb-primary);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'Plus Jakarta Sans', sans-serif;
    cursor: pointer;
    transition: var(--cb-transition);
    text-align: left;
    letter-spacing: 0.01em;
}

.cb-quick-btn:hover {
    background: var(--cb-primary-dim);
    border-color: var(--cb-primary);
    transform: translateX(4px);
}

/* CTA "Agendar" button */
.cb-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--cb-primary);
    color: #0a0904;
    font-weight: 800;
    font-size: 0.825rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    border: none;
    border-radius: var(--cb-radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: var(--cb-transition);
    box-shadow: 0 4px 20px var(--cb-primary-glow);
    align-self: flex-start;
    animation: cb-msg-in 0.3s ease 0.2s both;
}

.cb-cta-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 30px rgba(244, 192, 37, 0.4);
}

/* Typing indicator */
.cb-typing {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 0.625rem 0.875rem;
    background: var(--cb-surface);
    border: 1px solid var(--cb-border);
    border-radius: var(--cb-radius-sm);
    border-bottom-left-radius: 0.25rem;
    align-self: flex-start;
    animation: cb-msg-in 0.2s ease;
}

.cb-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cb-primary);
    animation: cb-dot-bounce 1.2s infinite;
}

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

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

@keyframes cb-dot-bounce {

    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    40% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* ── Input Area ────────────────────────────── */
#chatbot-input-area {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--cb-border);
    background: var(--cb-surface);
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

#chatbot-input {
    flex: 1;
    background: var(--cb-bg);
    border: 1px solid var(--cb-border);
    border-radius: 9999px;
    padding: 0.55rem 1rem;
    color: var(--cb-text);
    font-size: 0.8rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    outline: none;
    transition: border-color var(--cb-transition);
}

#chatbot-input::placeholder {
    color: var(--cb-text-muted);
}

#chatbot-input:focus {
    border-color: var(--cb-primary);
}

#chatbot-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--cb-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--cb-transition);
}

#chatbot-send:hover {
    transform: scale(1.1);
}

#chatbot-send svg {
    width: 16px;
    height: 16px;
    color: #0a0904;
}

/* ── Responsive mobile ─────────────────────── */
@media (max-width: 480px) {
    #chatbot-widget {
        bottom: 1rem;
        right: 1rem;
    }

    #chatbot-panel {
        width: calc(100vw - 2rem);
        height: calc(100svh - 120px);
        border-radius: var(--cb-radius-sm);
    }
}