/* CLEO AI System - Refined Premium Design System */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Inter:wght@400;500&display=swap');

:root {
    --cleo-gradient-primary: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
    --cleo-gradient-hover: linear-gradient(135deg, #6d28d9 0%, #4f46e5 100%);
    --cleo-bg: #ffffff;
    --cleo-dark-bg: #0f172a;
    --cleo-bot-msg: #f8fafc;
    --cleo-text: #1e293b;
    --cleo-text-light: #64748b;
    --cleo-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.15);
    --cleo-glass: rgba(255, 255, 255, 0.95);
    --cleo-border: rgba(226, 232, 240, 0.8);
}

#cleo-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

/* Floating Action Button */
.cleo-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--cleo-gradient-primary);
    box-shadow: 0 8px 15px -3px rgba(124, 58, 237, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: white;
    position: relative;
    overflow: hidden;
}

.cleo-fab:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 12px 20px -5px rgba(124, 58, 237, 0.5);
}

.cleo-fab svg {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

/* Chat Window */
.cleo-window {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 420px; /* Increased from 360px */
    height: 650px; /* Increased from 520px */
    max-height: calc(100vh - 110px);

    background: var(--cleo-bg);
    border-radius: 20px;
    box-shadow: var(--cleo-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom right;
    border: 1px solid var(--cleo-border);
}

.cleo-window.active {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Header */
.cleo-header {
    padding: 16px 20px;
    background: var(--cleo-gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.cleo-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.cleo-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.3);
}

.cleo-title h3 {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 600;
}

.cleo-status {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}

.cleo-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #4ade80;
    border-radius: 50%;
}

#cleo-close {
    position: relative;
    z-index: 1;
    transition: transform 0.2s;
    cursor: pointer;
    background: none;
    border: none;
    color: white;
}

#cleo-close:hover {
    transform: scale(1.1);
}

/* Chat History */
.cleo-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fcfcfd;
}

.cleo-messages::-webkit-scrollbar {
    width: 5px;
}
.cleo-messages::-webkit-scrollbar-track {
    background: transparent;
}
.cleo-messages::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

.message {
    font-family: 'Inter', sans-serif;
    max-width: 85%;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.5;
    white-space: pre-wrap;
    animation: slideUpFade 0.3s ease-out forwards;
}


@keyframes slideUpFade {
    0% { opacity: 0; transform: translateY(10px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.message.bot {
    align-self: flex-start;
    background: white;
    color: var(--cleo-text);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.message.bot ul, .message.bot ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message.bot li {
    margin-bottom: 4px;
}

.message.bot strong {
    color: #4f46e5;
    font-weight: 600;
}


.message.user {
    align-self: flex-end;
    background: var(--cleo-gradient-primary);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 5px rgba(124, 58, 237, 0.2);
}

/* Typist Animation */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.dot {
    width: 5px;
    height: 5px;
    background: #7c3aed;
    border-radius: 50%;
    animation: typingPulse 1.4s infinite ease-in-out;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingPulse {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-4px); opacity: 1; }
}

/* Input Area */
.cleo-input-area {
    padding: 14px;
    background: white;
    border-top: 1px solid var(--cleo-border);
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.cleo-input-area textarea {
    flex: 1;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 12px;
    padding: 10px 14px;
    resize: none;
    max-height: 100px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    outline: none;
    color: var(--cleo-text);
    transition: all 0.2s ease;
}

.cleo-input-area textarea:focus {
    border-color: #7c3aed;
    background: white;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.cleo-send-btn {
    background: var(--cleo-gradient-primary);
    color: white;
    border: none;
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.cleo-send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(124, 58, 237, 0.3);
}

.cleo-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: rgba(124, 58, 237, 0.05); /* Extremely faint purple */
    white-space: nowrap;
    pointer-events: none; /* So it doesn't block clicks */
    z-index: 0;
    user-select: none;
}

.cleo-footer-branding {
    position: relative;
    z-index: 10;
    padding: 10px;
    text-align: center;
    font-size: 11px;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    color: var(--cleo-text-light);
    background: white;
    border-top: 1px solid var(--cleo-border);
}

.cleo-footer-branding a {
    color: #7c3aed;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.cleo-footer-branding a:hover {
    color: #4f46e5;
    text-decoration: underline;
}

/* Mobile Responsiveness */
@media screen and (max-width: 480px) {
    #cleo-widget-container {
        right: 10px;
        bottom: 10px;
    }
    
    .cleo-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 70px;
    }
}

