/* ============================================= */
/* INTELLIGENT CHATBOT STYLES */
/* ============================================= */

#chatbotWidget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Chatbot Toggle Button */
.chatbot-toggle {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0052CC 0%, #00bcd4 100%);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 82, 204, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.chatbot-toggle:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(0, 82, 204, 0.4);
}

.chatbot-toggle:active {
    transform: scale(0.95);
}

/* Chatbot Container */
#chatbotContainer {
    position: static;
    width: 380px;
    height: 520px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
    overflow: hidden;
    margin-top: 10px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chatbot Header */
.chatbot-header {
    background: linear-gradient(135deg, #0052CC 0%, #00bcd4 100%);
    color: white;
    padding: 12px 14px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    flex-shrink: 0;
}

.chatbot-title {
    font-size: 13px;
    font-weight: 700;
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Messages Area */
.chatbot-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8f9fa;
    font-size: 14px;
    min-height: 120px;
}

.chatbot-messages::-webkit-scrollbar {
    width: 10px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* Messages - FIXED FOR FULL TEXT DISPLAY */
.chatbot-message {
    display: flex;
    animation: fadeIn 0.3s ease;
    width: 100%;
    word-wrap: break-word;
    word-break: break-word;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-user {
    justify-content: flex-end;
}

.chatbot-bot {
    justify-content: flex-start;
}

.chatbot-message-text {
    padding: 10px 14px;
    border-radius: 20px;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
    max-width: 85%;
    overflow-wrap: break-word;
}

.chatbot-user .chatbot-message-text {
    background: #0052CC;
    color: white;
    border-bottom-right-radius: 4px;
}

.chatbot-bot .chatbot-message-text {
    background: white;
    color: #333;
    border: 1px solid #ddd;
    border-bottom-left-radius: 4px;
}

/* Typing Indicator */
.chatbot-typing .chatbot-message-text {
    background: #e9ecef;
}

.chatbot-typing .chatbot-message-text::after {
    content: '';
    animation: typing 1.4s infinite;
}

@keyframes typing {
    0%, 60%, 100% { content: ''; }
    20% { content: '.'; }
    40% { content: '..'; }
}

/* Suggestions Area */
.chatbot-suggestions {
    padding: 0 14px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid #eee;
    max-height: 150px;
    overflow-y: auto;
    flex-shrink: 0;
    flex-basis: auto;
}

/* Suggestion Button */
.chatbot-suggestion-btn {
    padding: 5px 15px;
    background: #f0f4ff;
    border: 1px solid #d0d9ff;
    border-radius: 6px;
    color: #0052CC;
    font-size: 11px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    font-weight: 600;
}

.chatbot-suggestion-btn:hover {
    background: #e0e9ff;
    border-color: #0052CC;
}

.chatbot-suggestion-btn:active {
    transform: scale(0.98);
}

/* Suggestion Item (FAQ match) */
.chatbot-suggestion-item {
    padding: 5px;
    background: #f8f9fa;
    border-left: 3px solid #00bcd4;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.chatbot-suggestion-item:hover {
    background: #e8f4f8;
    transform: translateX(3px);
}

.chatbot-suggestion-item strong {
    color: #0052CC;
    display: block;
    margin-bottom: 3px;
    font-size: 11px;
}

.chatbot-suggestion-item small {
    color: #666;
    font-size: 11px;
}

/* Navigation Link */
.chatbot-nav-link {
    padding: 10px;
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    border-radius: 5px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.chatbot-nav-link:hover {
    background: #ffe99c;
    transform: translateX(4px);
}

/* Input Area */
.chatbot-inputarea {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    background: white;
    border-top: 1px solid #eee;
    border-radius: 0 0 12px 12px;
    flex-shrink: 0;
}

.chatbot-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border 0.2s;
}

.chatbot-input:focus {
    border-color: #0052CC;
}

.chatbot-send {
    width: 36px;
    height: 36px;
    background: #0052CC;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}

.chatbot-send:hover {
    background: #003d99;
}

.chatbot-send:active {
    transform: scale(0.95);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #chatbotContainer {
        width: calc(100vw - 30px);
        max-width: 340px;
        height: 500px;
        margin-top: 8px;
    }
    
    .chatbot-toggle {
        width: 52px;
        height: 52px;
        font-size: 22px;
    }
    
    .chatbot-message {
        width: 100%;
        max-width: 100%;
    }
    
    .chatbot-message-text {
        max-width: 90%;
    }
    
    .chatbot-header {
        padding: 10px 12px;
    }
    
    .chatbot-title {
        font-size: 12px;
    }
    
    .chatbot-messages {
        padding: 10px;
        gap: 8px;
        min-height: 100px;
    }
    
    .chatbot-suggestions {
        padding: 0 10px 8px 10px;
        max-height: 100px;
    }
    
    .chatbot-inputarea {
        gap: 5px;
        padding: 8px 10px;
    }
    
    .chatbot-input {
        padding: 7px 8px;
        font-size: 11px;
    }
    
    .chatbot-send {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    #chatbotContainer {
        max-width: 340px;
        height: 460px;
    }
}

/* Accessibility */
.chatbot-toggle:focus,
.chatbot-close:focus,
.chatbot-send:focus,
.chatbot-input:focus {
    outline: 2px solid #005eff;
    outline-offset: 2px;
}

/* Print hidden */
@media print {
    #chatbotWidget {
        display: none !important;
    }
}
