/* =============================================================
   CAPITALIS ELECTUS — AI Chat Widget Styles
   Negro + Dorado premium, matching el sitio principal.
   ============================================================= */

/* ── WIDGET ROOT ────────────────────────────────────────────── */
#ce-chat-widget {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 99999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── TOGGLE BUTTON ──────────────────────────────────────────── */
#ce-toggle {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #B8960C 0%, #D4AF37 45%, #F5DC6A 100%);
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 24px rgba(212, 175, 55, 0.50),
        0 2px 8px rgba(0, 0, 0, 0.6);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.25s ease;
    position: relative;
    animation: ce-pulse 3s ease-in-out infinite;
}

#ce-toggle:hover {
    transform: scale(1.1);
    box-shadow:
        0 6px 32px rgba(212, 175, 55, 0.70),
        0 2px 12px rgba(0, 0, 0, 0.7);
}

@keyframes ce-pulse {

    0%,
    100% {
        box-shadow: 0 4px 24px rgba(212, 175, 55, 0.50), 0 2px 8px rgba(0, 0, 0, 0.6);
    }

    50% {
        box-shadow: 0 4px 36px rgba(212, 175, 55, 0.75), 0 2px 12px rgba(0, 0, 0, 0.6);
    }
}

/* ── NOTIFICATION BADGE ─────────────────────────────────────── */
.ce-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #E53E3E;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #000;
    animation: ce-bounce 1.2s ease infinite;
}

@keyframes ce-bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.18);
    }
}

/* ── CHAT PANEL ──────────────────────────────────────────────── */
#ce-panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 360px;
    max-height: 560px;
    display: flex;
    flex-direction: column;
    background: #09090B;
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 18px;
    overflow: hidden;
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.80),
        0 0 0 1px rgba(212, 175, 55, 0.08),
        inset 0 1px 0 rgba(212, 175, 55, 0.12);
    transform-origin: bottom right;
}

/* Animated show/hide */
#ce-panel.ce-hidden {
    opacity: 0;
    transform: scale(0.88) translateY(12px);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#ce-panel.ce-visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: all;
    transition: opacity 0.25s ease, transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── HEADER ──────────────────────────────────────────────────── */
.ce-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #111108 0%, #0D0D0B 100%);
    border-bottom: 1px solid rgba(212, 175, 55, 0.20);
    flex-shrink: 0;
}

.ce-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2A2200 0%, #1A1500 100%);
    border: 1.5px solid rgba(212, 175, 55, 0.60);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.20);
}

.ce-header-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ce-agent-name {
    font-size: 14px;
    font-weight: 700;
    color: #D4AF37;
    letter-spacing: 0.02em;
}

.ce-status {
    font-size: 11px;
    color: #71717A;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ce-dot {
    width: 6px;
    height: 6px;
    background: #22C55E;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.60);
    animation: ce-pulse-dot 2s ease infinite;
}

@keyframes ce-pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

#ce-close {
    background: none;
    border: none;
    color: #52525B;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: color 0.2s, background 0.2s;
}

#ce-close:hover {
    color: #D4AF37;
    background: rgba(212, 175, 55, 0.10);
}

/* ── MESSAGES AREA ───────────────────────────────────────────── */
#ce-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

#ce-messages::-webkit-scrollbar {
    width: 4px;
}

#ce-messages::-webkit-scrollbar-track {
    background: transparent;
}

#ce-messages::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.25);
    border-radius: 2px;
}

/* ── MESSAGE BUBBLES ─────────────────────────────────────────── */
.ce-msg {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.55;
    animation: ce-msg-in 0.22s ease forwards;
}

@keyframes ce-msg-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bot message */
.ce-bot {
    background: rgba(212, 175, 55, 0.07);
    border: 1px solid rgba(212, 175, 55, 0.18);
    color: #E4E4E7;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.ce-bot strong {
    color: #D4AF37;
    font-weight: 600;
}

/* User message */
.ce-user {
    background: linear-gradient(135deg, #1A1500, #201A00);
    border: 1px solid rgba(212, 175, 55, 0.30);
    color: #F5DC6A;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
    text-align: right;
}

/* ── BULLETS IN BOT MESSAGE ──────────────────────────────────── */
.ce-bullets {
    margin: 6px 0 10px 0;
    padding-left: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ce-bullets li {
    padding-left: 18px;
    position: relative;
    font-size: 13px;
    color: #D4D4D8;
    line-height: 1.45;
}

.ce-bullets li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #D4AF37;
    box-shadow: 0 0 5px rgba(212, 175, 55, 0.50);
}

.ce-closer {
    font-size: 12.5px;
    color: #A1A1AA;
    margin: 8px 0 0 0;
    font-style: italic;
}

/* ── TYPING INDICATOR ────────────────────────────────────────── */
.ce-typing {
    display: flex !important;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
    width: fit-content;
}

.ce-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #D4AF37;
    display: inline-block;
    animation: ce-dot-bounce 1.1s ease-in-out infinite;
}

.ce-typing span:nth-child(2) {
    animation-delay: 0.18s;
}

.ce-typing span:nth-child(3) {
    animation-delay: 0.36s;
}

@keyframes ce-dot-bounce {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1.0);
        opacity: 1.0;
    }
}

/* ── CTA BUTTON ──────────────────────────────────────────────── */
.ce-cta-wrap {
    align-self: flex-start;
    margin-top: -4px;
    animation: ce-msg-in 0.25s ease forwards;
}

.ce-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    background: linear-gradient(135deg, #B8960C 0%, #D4AF37 60%, #F0C955 100%);
    color: #000;
    font-size: 12.5px;
    font-weight: 700;
    font-family: inherit;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 3px 14px rgba(212, 175, 55, 0.45);
    max-width: 100%;
    text-align: left;
    line-height: 1.3;
}

.ce-cta-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 22px rgba(212, 175, 55, 0.60);
}

/* ── QUICK CHIPS ─────────────────────────────────────────────── */
#ce-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 14px 10px 14px;
    flex-shrink: 0;
}

.ce-chip {
    padding: 5px 12px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 20px;
    color: #D4AF37;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
    white-space: nowrap;
}

.ce-chip:hover {
    background: rgba(212, 175, 55, 0.18);
    border-color: rgba(212, 175, 55, 0.55);
    color: #F5DC6A;
}

/* ── INPUT BAR ───────────────────────────────────────────────── */
.ce-input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    background: rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
}

#ce-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.20);
    border-radius: 20px;
    padding: 9px 14px;
    color: #E4E4E7;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#ce-input::placeholder {
    color: #52525B;
}

#ce-input:focus {
    border-color: rgba(212, 175, 55, 0.55);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.10);
}

#ce-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #B8960C, #D4AF37);
    border: none;
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.40);
}

#ce-send:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.55);
}

/* ── RESPONSIVE (mobile) ─────────────────────────────────────── */
@media (max-width: 480px) {
    #ce-panel {
        width: calc(100vw - 24px);
        right: -14px;
        bottom: 68px;
        max-height: 70vh;
    }

    #ce-chat-widget {
        bottom: 18px;
        right: 18px;
    }
}