/* chatbot.css - Updated with theme */
.chatbot-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 380px;
    height: 520px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), 
                0 0 0 2px var(--primary-blue),
                0 0 0 4px rgba(0, 86, 179, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    display: none;
    border: 1px solid rgba(0, 86, 179, 0.2);
    overflow: hidden;
}

.chatbot-container.active {
    display: flex;
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, #003d7a 100%);
    color: white;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chatbot-header h5 {
    margin: 0;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-header h5:before {
    content: '🤖';
    font-size: 1.2em;
}

.close-chat {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-chat:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.chatbot-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    background-attachment: fixed;
}

/* Custom scrollbar */
.chatbot-body::-webkit-scrollbar {
    width: 6px;
}

.chatbot-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chatbot-body::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 3px;
}

.chatbot-body::-webkit-scrollbar-thumb:hover {
    background: #004085;
}

.chatbot-input {
    padding: 18px 20px;
    border-top: 2px solid rgba(0, 86, 179, 0.1);
    background: white;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chatbot-input input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.chatbot-input input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
    background: white;
}

.chatbot-input button {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 86, 179, 0.3);
}

.chatbot-input button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 86, 179, 0.4);
}

.chatbot-input button:active {
    transform: translateY(0);
}

.chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, #003d7a 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 26px;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 6px 20px rgba(0, 86, 179, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 10px 25px rgba(0, 86, 179, 0.5);
}

.chatbot-toggle:before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        var(--primary-blue), 
        var(--accent-gold), 
        var(--primary-blue));
    border-radius: 50%;
    z-index: -1;
    animation: rotate 3s linear infinite;
}

.chatbot-toggle:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-blue) 0%, #003d7a 100%);
    border-radius: 50%;
    z-index: -1;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Messages */
.message {
    margin-bottom: 16px;
    padding: 14px 18px;
    border-radius: 18px;
    max-width: 85%;
    position: relative;
    animation: messageAppear 0.3s ease;
    line-height: 1.5;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 86, 179, 0.2);
}

.user-message:before {
    content: '';
    position: absolute;
    bottom: -1px;
    right: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent transparent var(--primary-blue);
}

.bot-message {
    background: white;
    color: var(--dark-steel);
    margin-right: auto;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.bot-message:before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: transparent #e9ecef transparent transparent;
}

.bot-message strong {
    color: var(--primary-blue);
}

.typing-indicator {
    background: white;
    padding: 15px 20px;
    border-radius: 18px;
    display: inline-flex;
    gap: 6px;
    border: 1px solid #e9ecef;
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--primary-blue);
    border-radius: 50%;
    opacity: 0.6;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { 
        transform: translateY(0);
        opacity: 0.6;
    }
    30% { 
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* Quick Actions */
.chat-quick-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 15px 0;
}

.quick-action-btn {
    background: white;
    border: 2px solid #e9ecef;
    color: var(--dark-steel);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.quick-action-btn:hover {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
    transform: translateY(-2px);
}

/* PDF Button */
#pdf-search-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.3);
}

#pdf-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(220, 53, 69, 0.4);
}

/* Message timestamp */
.message-time {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-top: 5px;
    text-align: right;
}

/* Responsive */
@media (max-width: 576px) {
    .chatbot-container {
        width: calc(100vw - 30px);
        height: 450px;
        bottom: 70px;
        right: 15px;
    }
    
    .chatbot-toggle {
        width: 56px;
        height: 56px;
        font-size: 22px;
        bottom: 15px;
        right: 15px;
    }
    
    .chatbot-header {
        padding: 15px;
    }
    
    .chatbot-body {
        padding: 15px;
    }
    
    .chatbot-input {
        padding: 15px;
    }
    
    .message {
        max-width: 90%;
        padding: 12px 15px;
    }
}