/* Glasgow MOT AI Chatbot CSS Stylesheet */
/* Glassmorphic dark theme matching the site guidelines */

#mot-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 50;
    font-family: 'Outfit', sans-serif;
}

/* Chat bubble button */
.chat-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a8a, #0b0f19);
    border: 2px solid rgba(245, 158, 11, 0.6);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 0 15px rgba(245, 158, 11, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #F59E0B;
    outline: none;
}

.chat-toggle-btn:hover {
    transform: scale(1.08) rotate(5deg);
    border-color: #F59E0B;
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.7), 0 0 25px rgba(245, 158, 11, 0.4);
}

.chat-toggle-btn svg {
    width: 28px;
    height: 28px;
    transition: transform 0.3s;
}

/* Chat box container */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 520px;
    max-height: calc(100vh - 120px);
    max-width: calc(100vw - 48px);
    border-radius: 20px;
    background: rgba(11, 15, 25, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Chat header */
.chat-header {
    padding: 16px 20px;
    background: linear-gradient(to right, #1e3a8a, #0b0f19);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.chat-header-title {
    font-weight: 700;
    color: #ffffff;
    font-size: 16px;
    margin: 0;
    line-height: 1.2;
}

.chat-header-subtitle {
    font-size: 11px;
    color: #94a3b8;
    margin: 0;
}

.chat-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

/* Chat messages body */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

/* Scrollbar styles */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Message block */
.chat-msg {
    max-width: 85%;
    display: flex;
    flex-direction: column;
    animation: msgFadeIn 0.3s ease forwards;
}

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

.chat-msg.user {
    align-self: flex-end;
}

.chat-msg.assistant {
    align-self: flex-start;
}

.chat-msg-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.chat-msg.user .chat-msg-bubble {
    background: #3B82F6;
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px -3px rgba(59, 130, 246, 0.4);
}

.chat-msg.assistant .chat-msg-bubble {
    background: rgba(30, 41, 59, 0.6);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 4px;
}

/* Links inside chat bubbles */
.chat-msg-bubble a {
    color: #F59E0B;
    font-weight: 700;
    text-decoration: underline;
    transition: color 0.2s;
}

.chat-msg-bubble a:hover {
    color: #fbbf24;
}

/* DeepSeek R1 Thinking block */
.think-container {
    margin-bottom: 10px;
    border-left: 2px solid rgba(245, 158, 11, 0.5);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    overflow: hidden;
}

.think-header {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: bold;
    color: #a1a1aa;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
    transition: background 0.2s;
}

.think-header:hover {
    background: rgba(255, 255, 255, 0.06);
}

.think-toggle-icon {
    transition: transform 0.2s;
}

.think-container.collapsed .think-toggle-icon {
    transform: rotate(-90deg);
}

.think-body {
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.4;
    color: #a1a1aa;
    font-style: italic;
    white-space: pre-wrap;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.think-container.collapsed .think-body {
    display: none;
}

/* Typing indicator */
.chat-typing-indicator {
    align-self: flex-start;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-typing-dot {
    width: 6px;
    height: 6px;
    background-color: #94a3b8;
    border-radius: 50%;
    animation: chatTyping 1.4s infinite ease-in-out both;
}

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

@keyframes chatTyping {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* Chat input footer */
.chat-footer {
    padding: 16px;
    background: rgba(15, 23, 42, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-input-form {
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    background: rgba(11, 15, 25, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.chat-input:focus {
    border-color: rgba(245, 158, 11, 0.6);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
    background: rgba(11, 15, 25, 0.8);
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #F59E0B;
    border: none;
    color: #0b0f19;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    outline: none;
}

.chat-send-btn:hover {
    background: #fbbf24;
    transform: translateY(-1px);
}

.chat-send-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    transform: none;
}
