.cae-ai-chat-container {
    width: 100%;
    height: 600px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(14, 57, 80, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    position: relative;
    z-index: 999998;
}

.cae-ai-chat-inline-container {
    max-width: 100%;
    margin: 20px 0;
}

.cae-ai-chat-bubble-container {
    position: fixed;
    bottom: 130px;
    right: 30px;
    width: 400px;
    max-width: calc(100vw - 60px);
    height: 600px;
    max-height: calc(100vh - 140px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.cae-ai-chat-header {
    background: #0E3950;
    padding: 25px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cae-ai-bot-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cae-ai-bot-info .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px;
    border-radius: 12px;
}

.cae-ai-bot-info strong {
    display: block;
    font-size: 1.1em;
}

.cae-status-online {
    font-size: 0.8em;
    color: #4ade80;
    display: flex;
    align-items: center;
    gap: 5px;
}

.cae-status-online::before {
    content: "";
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 10px #4ade80;
}

.cae-ai-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
}

.cae-message {
    max-width: 85%;
    padding: 15px 20px;
    border-radius: 18px;
    font-size: 0.95em;
    line-height: 1.5;
    position: relative;
    animation: cae-fade-in 0.3s ease-out;
}

@keyframes cae-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.cae-message-bot {
    align-self: flex-start;
    background: #fff;
    color: #334155;
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    border: 1px solid #e2e8f0;
}

.cae-message-user {
    align-self: flex-end;
    background: #0E3950;
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 10px 15px rgba(14, 57, 80, 0.1);
}

/* Markdown Styles */
.cae-message ul {
    margin: 10px 0 10px 20px;
    padding: 0;
    list-style-type: disc;
}

.cae-message li {
    margin-bottom: 5px;
}

.cae-message strong {
    font-weight: 700;
}

.cae-message a {
    color: #ECAD20;
    text-decoration: underline;
    font-weight: 600;
}

.cae-message-user a {
    color: #fff;
}

.cae-message br {
    display: block;
    content: "";
    margin-top: 8px;
}

.cae-ai-chat-footer {
    padding: 20px;
    background: #fff;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 12px;
}

#cae-ai-chat-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.95em;
    transition: all 0.2s;
    outline: none;
}

#cae-ai-chat-input:focus {
    border-color: #ECAD20;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(236, 173, 32, 0.1);
}

#cae-ai-chat-send {
    background: #0E3950 !important;
    border: none !important;
    width: 45px !important;
    height: 45px !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    text-indent: 0 !important;
    overflow: visible !important;
}

#cae-ai-chat-send svg {
    width: 24px !important;
    height: 24px !important;
    display: block !important;
    margin: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
}

#cae-ai-chat-send svg path {
    fill: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
}

#cae-ai-chat-send:hover {
    background: #ECAD20 !important;
    transform: scale(1.05);
}

#cae-ai-chat-send:hover svg path {
    fill: #0E3950 !important;
}

.cae-ai-chat-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
}

.cae-ai-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.cae-ai-bubble-launcher {
    position: fixed;
    bottom: 70px;
    right: 30px;
    display: flex;
    align-items: center;
    cursor: pointer;
    z-index: 999999;
    background: transparent;
    border: none;
    padding: 0;
}

.cae-ai-bubble-icon {
    width: 60px;
    height: 60px;
    background: #0E3950;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(14, 57, 80, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2;
}

.cae-ai-bubble-icon .dashicons {
    font-size: 30px;
    width: 30px;
    height: 30px;
}

.cae-ai-bubble-cta {
    background: #0E3950;
    color: #fff;
    padding: 10px 20px;
    border-radius: 30px;
    margin-right: 15px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    pointer-events: none;
    z-index: 1;
}

.cae-ai-bubble-launcher:hover .cae-ai-bubble-icon {
    transform: scale(1.1);
    background: #ECAD20;
    color: #0E3950;
}

.cae-ai-bubble-launcher:hover .cae-ai-bubble-cta {
    background: #ECAD20;
    color: #0E3950;
}

.cae-ai-bubble-launcher.active .cae-ai-bubble-icon {
    transform: rotate(450deg) scale(0.9);
    background: #ef4444;
}

.cae-ai-bubble-launcher.active .cae-ai-bubble-cta {
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
}

/* Ocultar CTA en móviles */
@media screen and (max-width: 768px) {
    .cae-ai-bubble-cta {
        display: none;
    }

    .cae-ai-bubble-launcher {
        bottom: 30px;
        /* Ajustar posición en móvil si es necesario */
    }

    .cae-ai-chat-bubble-container {
        right: 15px;
        left: 15px;
        width: auto;
        bottom: 100px;
    }
}

/* Typing indicator */
.cae-typing {
    display: flex;
    gap: 4px;
    padding: 10px 15px;
}

.cae-typing span {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: cae-typing 1s infinite alternate;
}

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

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

@keyframes cae-typing {
    from {
        opacity: 0.3;
        transform: scale(1);
    }

    to {
        opacity: 1;
        transform: scale(1.2);
    }
}