/* AI Chatbot Styling */

/* Floating Chat Button */
.chatbot-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
    border: none;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

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

/* Chat Window */
.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 400px;
    height: 550px;
    background: #1a1c2e;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    border: 1px solid #2d3154;
}

.chatbot-window.show {
    display: flex;
    animation: slideUp 0.3s ease;
}

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

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

.chatbot-header-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.chatbot-header-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 14px;
}

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

/* Chat Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #1a1c2e;
}

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

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

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

/* Message Bubbles */
.chat-message {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

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

.chat-message.user {
    align-items: flex-end;
}

.chat-message.assistant {
    align-items: flex-start;
}

.chat-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 14px;
}

.chat-message.user .chat-bubble {
    background: #667eea;
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.assistant .chat-bubble {
    background: #2d3154;
    color: #e0e0e0;
    border-bottom-left-radius: 4px;
}

/* Code Blocks in Messages */
.chat-bubble pre {
    background: #0d1117;
    border-radius: 6px;
    padding: 12px;
    overflow-x: auto;
    margin: 8px 0;
    border: 1px solid #30363d;
}

.chat-bubble code {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #60a5fa;
}

.chat-bubble pre code {
    color: #e0e0e0;
}

/* Inline code */
.chat-bubble p code {
    background: #0d1117;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #2d3154;
    border-radius: 12px;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Chat Input Area */
.chatbot-input-area {
    padding: 16px 20px;
    background: #2d3154;
    border-top: 1px solid #3a3f5c;
    display: flex;
    gap: 10px;
}

.chatbot-input {
    flex: 1;
    background: #1a1c2e;
    border: 1px solid #3a3f5c;
    border-radius: 8px;
    padding: 10px 14px;
    color: white;
    font-size: 14px;
    outline: none;
    resize: none;
    max-height: 100px;
    min-height: 40px;
    font-family: inherit;
}

.chatbot-input:focus {
    border-color: #667eea;
}

.chatbot-input::placeholder {
    color: #6c6f8a;
}

.chatbot-send-btn {
    background: #667eea;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.chatbot-send-btn:hover:not(:disabled) {
    background: #5568d3;
}

.chatbot-send-btn:disabled {
    background: #4a4d6b;
    cursor: not-allowed;
    opacity: 0.5;
}

.chatbot-send-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Error Message */
.chat-error {
    background: #dc2626;
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    margin: 0 20px 16px 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Welcome Message */
.chat-welcome {
    text-align: center;
    color: #8b8fa8;
    font-size: 14px;
    padding: 40px 20px;
}

.chat-welcome-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.chat-welcome h3 {
    color: #e0e0e0;
    font-size: 18px;
    margin-bottom: 8px;
}

.chat-welcome p {
    margin-bottom: 4px;
}

/* Tablet Responsive */
@media (max-width: 1024px) {
    .chatbot-window {
        width: 380px;
        height: 500px;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        right: 10px;
        bottom: 10px;
        left: 10px;
        margin: 0 auto;
        border-radius: 12px;
    }
    
    .chatbot-toggle {
        right: 20px;
        bottom: 20px;
        width: 56px;
        height: 56px;
    }
    
    .chatbot-toggle svg {
        width: 26px;
        height: 26px;
    }
    
    .chatbot-header {
        padding: 14px 16px;
    }
    
    .chatbot-header-title {
        font-size: 15px;
    }
    
    .chatbot-messages {
        padding: 16px;
    }
    
    .chat-bubble {
        max-width: 85%;
        font-size: 14px;
    }
    
    .chatbot-input-area {
        padding: 12px 16px;
    }
    
    .chatbot-input {
        font-size: 15px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 10px);
        height: calc(100vh - 80px);
        right: 5px;
        bottom: 5px;
        left: 5px;
    }
    
    .chatbot-toggle {
        width: 52px;
        height: 52px;
        right: 15px;
        bottom: 15px;
    }
    
    .chatbot-header {
        padding: 12px 14px;
    }
    
    .chatbot-header-title {
        font-size: 14px;
    }
    
    .chatbot-messages {
        padding: 12px;
    }
    
    .chat-bubble {
        max-width: 90%;
        font-size: 13px;
        padding: 10px 14px;
    }
    
    .chat-welcome {
        padding: 30px 16px;
    }
    
    .chat-welcome-icon {
        font-size: 40px;
    }
    
    .chat-welcome h3 {
        font-size: 16px;
    }
    
    .chat-welcome p {
        font-size: 13px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .chatbot-window {
        height: calc(100vh - 20px);
        bottom: 10px;
    }
    
    .chatbot-messages {
        padding: 12px;
    }
}
