/* Clonic Bot - Estilos Consolidados */

:root {
    --clonic-cyan: #2cfbcd;
}

#chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

[id^="chat-window"] {
    width: 320px;
    height: 400px;
    background-color: #1a1a1a;
    border: 2px solid var(--clonic-cyan);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-size: 14px;
}

[id^="chat-header"] {
    background-color: rgba(44, 251, 205, 0.1);
    color: white;
    padding: 10px;
    border-bottom: 2px solid var(--clonic-cyan);
    font-weight: bold;
}

[id^="chat-messages"] {
    flex-grow: 1;
    padding: 10px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* Scrollbar Personalizado */
[id^="chat-messages"]::-webkit-scrollbar {
    width: 4px;
}
[id^="chat-messages"]::-webkit-scrollbar-track {
    background: #0a0a0a;
}
[id^="chat-messages"]::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 10px;
}
[id^="chat-messages"]::-webkit-scrollbar-thumb:hover {
    background: var(--clonic-cyan);
}

.message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    max-width: 85%;
    line-height: 1.4;
}

.user-message {
    background-color: rgba(44, 251, 205, 0.125);
    color: #e5e7eb;
    margin-left: auto;
}

.bot-message {
    background-color: #374151;
    color: white;
    margin-right: auto;
}

[id^="chat-input-container"] {
    display: flex;
    padding: 10px;
    border-top: 1px solid #374151;
}

input[id^="chat-input"] {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #4b5563;
    border-radius: 6px;
    background-color: #0a0a0a;
    color: white;
    outline: none;
    margin-right: 8px;
}

[id^="send-button"] {
    background-color: var(--clonic-cyan);
    color: #0a0a0a;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
}

[id^="chat-toggle-button"] {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--clonic-cyan);
    color: #0a0a0a;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loader Inteligente (Cerebro + Texto dinámico) */
.clonic-loader {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    font-size: 13px;
    color: #9ca3af; /* Gris sutil en lugar de cian */
    font-weight: 500;
}

.clonic-loader svg {
    width: 18px;
    height: 18px;
    color: #9ca3af;
    animation: clonic-pulse 1.5s infinite ease-in-out;
}

.clonic-loader-text {
    animation: clonic-pulse 1.5s infinite ease-in-out;
}

@keyframes clonic-pulse {
    0%, 100% { opacity: 0.3; transform: scale(0.98); }
    50% { opacity: 0.8; transform: scale(1.02); }
}

.loading-dots {
    display: none !important; /* Obsoleto */
}

.ai-result-card {
    background-color: #1f2937;
    border: 1px solid rgba(44, 251, 205, 0.3);
    padding: 10px;
    border-radius: 8px;
}

.hidden {
    display: none !important;
}

.bot-message a {
    color: var(--clonic-cyan);
    text-decoration: underline;
    font-weight: bold;
    transition: opacity 0.2s;
}

.bot-message a:hover {
    opacity: 0.8;
}

/* Modo Inline / Embebido */
#clonic-bot-embed {
    /*user may define in her own css*/
}

#clonic-bot-embed .chat-container {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
}

#clonic-bot-embed [id^="chat-window"] {
    width: 100% !important;
    height: 100% !important;
    min-height: 400px;
    display: flex !important;
    position: relative !important;
    border-radius: 8px;
    max-width: 100% !important;
}

#clonic-bot-embed [id^="chat-toggle-button"] {
    display: none !important;
}
