/* static/css/components/chatbot.css */
.chat-widget-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1050;
    font-family: inherit;
}

.chat-launcher {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-gradient, linear-gradient(135deg, #2C2048 0%, #E471AB 100%));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-medium, 0 16px 48px rgba(0,0,0,0.15));
    cursor: pointer;
    transition: transform 0.3s ease;
}

.chat-launcher:hover {
    transform: scale(1.05);
}

.chat-launcher i {
    font-size: 28px;
    line-height: 1;
}

.chat-send i {
    font-size: 18px;
    line-height: 1;
}

.chat-window {
    display: none;
    position: absolute;
    bottom: 0;
    right: 0;
    width: 350px;
    height: 480px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-heavy, 0 24px 64px rgba(0,0,0,0.2));
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chat-window.open {
    display: flex;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-header {
    background: var(--primary-gradient, linear-gradient(135deg, #2C2048 0%, #E471AB 100%));
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.chat-body {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f8f9fc;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
}

.chat-body::-webkit-scrollbar {
    width: 6px;
}
.chat-body::-webkit-scrollbar-thumb {
    background-color: #d9d9d9;
    border-radius: 3px;
}

.chat-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message.user {
    align-self: flex-end;
    background: var(--bg-own-blue, #284b63);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.ai {
    align-self: flex-start;
    background: white;
    color: var(--color-own-primary, #2C2048);
    border: 1px solid var(--border-own-gray, #d9d9d9);
    border-bottom-left-radius: 4px;
}

.chat-footer {
    padding: 15px;
    background: white;
    border-top: 1px solid var(--border-own-gray, #d9d9d9);
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input {
    flex-grow: 1;
    border: 1px solid var(--border-own-gray, #d9d9d9);
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    background-color: #f8f9fc;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: var(--border-own-blue, #284b63);
    background-color: white;
}

.chat-send {
    background: var(--bg-own-primary, #2C2048);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-send:hover {
    background: var(--bg-own-blue, #284b63);
}

.chat-loading {
    display: flex;
    gap: 4px;
    padding: 5px 10px;
    align-self: flex-start;
}
.chat-loading span {
    width: 6px;
    height: 6px;
    background: var(--border-own-gray, #d9d9d9);
    border-radius: 50%;
    animation: typing 0.8s infinite alternate;
}
.chat-loading span:nth-child(2) { animation-delay: 0.2s; }
.chat-loading span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0% { transform: translateY(0); }
    100% { transform: translateY(-5px); }
}

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 5px;
}
.chat-suggestion-chip {
    background: white;
    border: 1px solid var(--bg-own-secondary, #E471AB);
    color: var(--bg-own-secondary, #E471AB);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.chat-suggestion-chip:hover {
    background: var(--bg-own-secondary, #E471AB);
    color: white;
}

/* Ensure parsed markdown looks good */
.chat-message.ai p {
    margin-bottom: 8px;
}
.chat-message.ai p:last-child {
    margin-bottom: 0;
}
.chat-message.ai ul, .chat-message.ai ol {
    margin-bottom: 8px;
    padding-left: 20px;
}
.chat-message.ai strong {
    font-weight: 600;
}
