/* AI Chatbot Styles - Elite Licensing Colors */

.ai-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.chatbot-toggle {
    background: linear-gradient(135deg, #FF6B00 0%, #E55D00 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 24px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.chatbot-toggle:hover {
    background: linear-gradient(135deg, #E55D00 0%, #CC5200 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 0, 0.4);
}

.chatbot-toggle.open {
    background: #666;
}

.chatbot-toggle.open:hover {
    background: #555;
}

.chatbot-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.chatbot-window {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 550px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
    z-index: 10000;
}

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

.chatbot-header {
    background: linear-gradient(135deg, #004B8D 0%, #003D73 100%);
    color: white;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #FF6B00;
}

.chatbot-header h4 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
}

.chatbot-header .close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.chatbot-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

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

.chatbot-messages::-webkit-scrollbar {
    width: 8px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

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

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

.message.user {
    justify-content: flex-end;
}

.message.assistant {
    justify-content: flex-start;
}

.message-content {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
}

.message.user .message-content {
    background: linear-gradient(135deg, #FF6B00 0%, #E55D00 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.message-content strong {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    opacity: 0.9;
}

.message-text {
    font-size: 15px;
    line-height: 1.5;
}

.message.user .message-text {
    color: white;
}

.message.assistant .message-text {
    color: #333;
}

.sources {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 13px;
}

.message.user .sources {
    border-top-color: rgba(255, 255, 255, 0.3);
}

.sources strong {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
}

.sources a {
    display: block;
    color: #004B8D;
    text-decoration: none;
    margin: 4px 0;
    padding: 4px 8px;
    background: rgba(0, 75, 141, 0.05);
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 12px;
}

.message.user .sources a {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

.sources a:hover {
    background: rgba(0, 75, 141, 0.1);
    transform: translateX(4px);
}

.message.user .sources a:hover {
    background: rgba(255, 255, 255, 0.3);
}

.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 8px 0;
    align-items: center;
}

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

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

.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.3;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.chatbot-input {
    display: flex;
    padding: 16px;
    background: white;
    border-top: 1px solid #e0e0e0;
    gap: 10px;
}

.question-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.question-input:focus {
    border-color: #FF6B00;
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
}

.question-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.send-btn {
    background: linear-gradient(135deg, #FF6B00 0%, #E55D00 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 24px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    white-space: nowrap;
}

.send-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #E55D00 0%, #CC5200 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 107, 0, 0.2);
}

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

.chatbot-footer {
    padding: 12px 16px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: center;
}

.clear-btn {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.clear-btn:hover:not(:disabled) {
    background: #f0f0f0;
    border-color: #999;
    color: #333;
}

.clear-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ai-chatbot-container {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }

    .chatbot-window {
        width: 100%;
        height: calc(100vh - 100px);
        max-height: calc(100vh - 100px);
        bottom: 70px;
        right: 0;
        left: 0;
        border-radius: 16px 16px 0 0;
    }

    .chatbot-toggle {
        position: absolute;
        right: 10px;
        width: 56px;
        height: 56px;
        font-size: 22px;
    }

    .message-content {
        max-width: 90%;
    }
}
