/* =========================================
   Cerebras AI Chatbot Widget Styles
========================================= */

/* AI Chat Widget Container */
#ai-chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}

/* Chat Button (FAB) */
.chat-fab-button {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(135deg, #facc15, #f59e0b, #d97706);
    color: #111827;
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.5), 0 0 0 0 rgba(245, 158, 11, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.8);
    outline: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: pulse-fab 2s infinite cubic-bezier(0.66, 0, 0, 1);
}

.chat-fab-button:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 35px rgba(245, 158, 11, 0.6);
}

@keyframes pulse-fab {
    to {
        box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4), 0 0 0 25px rgba(245, 158, 11, 0);
    }
}

/* Notification Badge / Tooltip to grab attention */
.chat-notice {
    position: absolute;
    top: -55px;
    right: 0;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #facc15;
    padding: 10px 16px;
    border-radius: 20px;
    border: 1px solid rgba(250, 204, 21, 0.3);
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5), 0 0 15px rgba(245, 158, 11, 0.2);
    white-space: nowrap;
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    transition: all 0.3s ease;
    pointer-events: none;
    letter-spacing: 0.5px;
}

.chat-notice::after {
    content: '';
    position: absolute;
    bottom: -7px;
    right: 25px;
    border-width: 7px 7px 0;
    border-style: solid;
    border-color: #0f172a transparent transparent transparent;
}

.chat-notice.show-notice {
    animation: bounce-notice 2s infinite;
    opacity: 1;
    transform: translateY(0) scale(1);
}

@keyframes bounce-notice {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Chat Window - Premium Glassmorphism */
.chat-window {
    position: absolute;
    bottom: 90px;
    right: 0;
    width: 380px;
    height: 550px;
    max-height: 85vh;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
    pointer-events: none;
}

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

/* Chat Header */
.chat-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-title i {
    color: #facc15;
    font-size: 24px;
    filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.6));
}

.chat-title h3 {
    margin: 0;
    color: #ffffff;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.chat-title span {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.close-chat-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #94a3b8;
    font-size: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.close-chat-btn:hover {
    color: white;
    background: rgba(244, 63, 94, 0.8);
    border-color: rgba(244, 63, 94, 1);
    transform: rotate(90deg);
}

/* Chat Body (Messages) */
.chat-body {
    flex: 1;
    padding: 20px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
}

.chat-body::-webkit-scrollbar {
    width: 5px;
}
.chat-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

/* Chat Bubbles */
.chat-message {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 20px;
    font-size: 14.5px;
    line-height: 1.6;
    word-wrap: break-word;
    animation: fade-in-up 0.4s ease forwards;
    letter-spacing: 0.2px;
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-bot {
    align-self: flex-start;
    background: rgba(30, 41, 59, 0.7);
    color: #f8fafc;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.message-bot h1, .message-bot h2, .message-bot h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    color: #facc15;
}
.message-bot pre {
    background: rgba(0, 0, 0, 0.4);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin: 10px 0;
}
.message-bot code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: #38bdf8;
    background: rgba(0,0,0,0.3);
    padding: 2px 5px;
    border-radius: 4px;
}
.message-bot pre code {
    background: transparent;
    padding: 0;
}
.message-bot a {
    color: #facc15;
    text-decoration: none;
    border-bottom: 1px dashed #facc15;
}

.message-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #0ea5e9, #3b82f6);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
    font-weight: 500;
}

/* Thinking Indicator */
.thinking-indicator {
    display: flex;
    gap: 5px;
    padding: 14px 18px;
    background: rgba(30, 41, 59, 0.7);
    border-radius: 20px;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    align-self: flex-start;
    width: fit-content;
}

.thinking-dot {
    width: 6px;
    height: 6px;
    background: #facc15;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

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

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}

/* Chat Input Area */
.chat-input-area {
    padding: 16px 24px;
    background: rgba(15, 23, 42, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 12px;
    align-items: center;
}

.chat-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 14px 18px;
    border-radius: 24px;
    font-size: 14.5px;
    outline: none;
    transition: all 0.3s;
}

.chat-input-area input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.chat-input-area input:focus {
    border-color: #facc15;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(250, 204, 21, 0.15);
}

.chat-input-area button {
    background: linear-gradient(135deg, #facc15, #f59e0b);
    color: #111827;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

.chat-input-area button:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 6px 15px rgba(245, 158, 11, 0.4);
}

.chat-input-area button:disabled {
    background: #475569;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chat-window {
        width: calc(100vw - 40px);
        right: -10px;
        bottom: 100px;
    }
}
