/* V.R.C Chatbot Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    color: #1a1a2e;
}

.chatbot-container {
    max-width: 900px;
    margin: 100px auto 20px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px);
    overflow: hidden;
}

/* Header */
.chatbot-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bot-avatar {
    font-size: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.title-text h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: #ffffff;
}

.status-indicator {
    font-size: 0.85rem;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.online {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.status-indicator.online::before {
    background: #4ade80;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chatbot-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    color: #ffffff;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
}

/* Export Dropdown */
.export-dropdown {
    position: relative;
}

.export-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    min-width: 150px;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.export-menu.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

.export-option {
    display: block;
    padding: 12px 16px;
    color: #374151;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.export-option:hover {
    background: #f3f4f6;
    color: #667eea;
}

.export-option:not(:last-child) {
    border-bottom: 1px solid #e2e8f0;
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f8fafc;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Messages */
.message {
    display: flex;
    gap: 12px;
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

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

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.bot-message {
    align-self: flex-start;
}

.message-avatar {
    font-size: 24px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message-content {
    padding: 14px 18px;
    border-radius: 16px;
    line-height: 1.5;
    color: #1e293b;
}

.bot-message .message-content {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-top-left-radius: 4px;
    color: #1e293b;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.user-message .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-top-right-radius: 4px;
    color: #ffffff;
}

.message-content p {
    margin-bottom: 8px;
    color: inherit;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-hint {
    font-size: 0.85rem;
    color: #64748b;
    font-style: italic;
}

/* Suggestions */
.suggestions-container {
    margin: 8px 0 16px;
    padding-left: 52px;
}

.suggestions-title {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 8px;
}

.suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-btn {
    background: #ffffff;
    border: 1px solid #c7d2fe;
    border-radius: 20px;
    padding: 8px 16px;
    color: #4f46e5;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-btn:hover {
    background: #eef2ff;
    border-color: #667eea;
    transform: translateY(-2px);
}

/* Input Area */
.chat-input-container {
    padding: 20px 24px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

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

.chat-input {
    flex: 1;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 18px;
    color: #1e293b;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
}

.chat-input::placeholder {
    color: #94a3b8;
}

.chat-input:focus {
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.input-hint {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 8px;
    text-align: center;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

/* Error Message */
.error-message {
    background: #fef2f2 !important;
    border-color: #fca5a5 !important;
    color: #dc2626 !important;
}

/* Message Actions - Flag Button */
.message-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #e2e8f0;
}

.flag-btn {
    background: none;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
}

.flag-btn:hover {
    color: #f59e0b;
    background: #fffbeb;
}

.flag-btn:disabled {
    color: #e2e8f0;
    cursor: not-allowed;
    background: none;
}

.flag-btn svg {
    width: 14px;
    height: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .chatbot-container {
        margin: 80px 10px 10px;
        height: calc(100vh - 100px);
        border-radius: 12px;
    }

    .chatbot-header {
        padding: 16px;
    }

    .bot-avatar {
        width: 44px;
        height: 44px;
        font-size: 28px;
    }

    .title-text h1 {
        font-size: 1.2rem;
    }

    .message {
        max-width: 90%;
    }

    .chat-messages {
        padding: 16px;
    }

    .suggestions-container {
        padding-left: 0;
    }
}
