/* MOGAD AI Chatbot Widget Styles */
/* Modern, responsive chatbot interface inspired by Amazon Rufus */

.chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color, #2563eb) 0%, var(--primary-dark, #1e40af) 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
}

.chatbot-button svg {
    width: 30px;
    height: 30px;
    fill: white;
}

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    display: none;
}

.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chatbot-window.active {
    display: flex;
}

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

.chatbot-header {
    background: linear-gradient(135deg, var(--primary-color, #2563eb) 0%, var(--primary-dark, #1e40af) 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chatbot-header p {
    margin: 5px 0 0 0;
    font-size: 13px;
    opacity: 0.9;
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.chatbot-message {
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

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

.chatbot-message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.message-avatar.bot {
    background: linear-gradient(135deg, var(--primary-color, #2563eb) 0%, var(--primary-dark, #1e40af) 100%);
    color: white;
}

.message-avatar.user {
    background: #e3e8ef;
    color: #4a5568;
}

.message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 14px;
}

.message-content.bot {
    background: white;
    border: 1px solid #e3e8ef;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.message-content.user {
    background: linear-gradient(135deg, var(--primary-color, #2563eb) 0%, var(--primary-dark, #1e40af) 100%);
    color: white;
}

.message-citation {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e3e8ef;
    font-size: 12px;
    color: #718096;
}

.message-citation a {
    color: var(--primary-color, #2563eb);
    text-decoration: none;
    font-weight: 500;
}

.message-citation a:hover {
    text-decoration: underline;
}

.chatbot-typing {
    display: none;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e3e8ef;
    max-width: 60px;
}

.chatbot-typing.active {
    display: block;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color, #2563eb);
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.chatbot-input-area {
    padding: 16px;
    background: white;
    border-top: 1px solid #e3e8ef;
}

.chatbot-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e3e8ef;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input:focus {
    border-color: var(--primary-color, #2563eb);
}

.chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color, #2563eb) 0%, var(--primary-dark, #1e40af) 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.chatbot-send:hover:not(:disabled) {
    transform: scale(1.1);
}

.chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chatbot-suggestions {
    padding: 12px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-chip {
    padding: 8px 14px;
    background: white;
    border: 1px solid #e3e8ef;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-chip:hover {
    background: var(--primary-color, #2563eb);
    color: white;
    border-color: var(--primary-color, #2563eb);
}

.chatbot-questions-menu {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 16px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.chatbot-questions-menu::-webkit-scrollbar {
    width: 6px;
}

.chatbot-questions-menu::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.chatbot-questions-menu::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.chatbot-questions-menu::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.question-item {
    padding: 14px 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.question-item::before {
    content: '→';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--primary-color, #2563eb);
    font-weight: 700;
    font-size: 16px;
}

.question-item:hover {
    background: linear-gradient(135deg, var(--primary-color, #2563eb) 0%, var(--primary-dark, #1e40af) 100%);
    color: white;
    border-color: var(--primary-color, #2563eb);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.question-item:hover::before {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
    color: white;
}

.question-item:active {
    transform: translateX(2px) scale(0.98);
}

.chatbot-disclaimer {
    padding: 12px;
    background: #fff3cd;
    border-top: 1px solid #ffc107;
    font-size: 11px;
    color: #856404;
    text-align: center;
}

@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        right: 10px;
    }
}
