/**
 * ADVANCED AI CHATBOT - Styling
 * Modern, sleek design for AI-powered conversations
 */

/* Widget Container */
#chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Main Window */
#chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    height: 650px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    transform: scale(0.8);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

#chatbot-window.active {
    transform: scale(1);
    opacity: 1;
    visibility: visible;
}

/* Header */
#chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
}

#chatbot-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

#chatbot-header h3 i {
    font-size: 20px;
}

#chatbot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.9;
    margin-top: 4px;
}

#chatbot-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

#chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Messages Area */
#chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    scroll-behavior: smooth;
}

#chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

#chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

#chatbot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

#chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Welcome Message */
.chatbot-welcome {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chatbot-ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chatbot-welcome h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #1a202c;
}

.chatbot-welcome p {
    margin: 0;
    color: #4a5568;
    font-size: 14px;
    line-height: 1.5;
}

/* Quick Suggestions */
.chatbot-suggestions {
    margin-bottom: 15px;
}

.chatbot-suggestion {
    display: block;
    width: 100%;
    background: white;
    border: 2px solid #e2e8f0;
    color: #4a5568;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    text-align: left;
    transition: all 0.3s;
}

.chatbot-suggestion:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    transform: translateX(5px);
}

/* Message Bubbles */
.chatbot-message {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: flex-start;
}

.chatbot-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.chatbot-message.user .chatbot-message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.chatbot-message.bot .chatbot-message-avatar {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.chatbot-message-content {
    flex: 1;
    max-width: calc(100% - 48px);
}

.chatbot-message-text {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: #2d3748;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    word-wrap: break-word;
}

.chatbot-message.user .chatbot-message-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.chatbot-message-text strong {
    font-weight: 600;
}

.chatbot-message-text em {
    font-style: italic;
}

.chatbot-message-text a {
    color: inherit;
    text-decoration: underline;
}

.chatbot-message-time {
    font-size: 11px;
    color: #a0aec0;
    margin-top: 4px;
    padding-left: 4px;
}

/* Typing Indicator */
.chatbot-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    width: fit-content;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.chatbot-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e0;
    animation: typing 1.4s infinite;
}

.chatbot-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chatbot-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        background: #cbd5e0;
    }
    30% {
        transform: translateY(-10px);
        background: #667eea;
    }
}

.chatbot-typing-text {
    font-size: 11px;
    color: #a0aec0;
    margin-top: 4px;
    padding-left: 4px;
}

/* Error Messages */
.chatbot-error {
    background: #fee;
    border-left: 3px solid #f56565;
    color: #c53030;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-error i {
    font-size: 16px;
}

/* Input Container */
#chatbot-input-container {
    background: white;
    padding: 16px;
    border-top: 1px solid #e2e8f0;
}

#chatbot-input-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#chatbot-input {
    flex: 1;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    transition: all 0.3s;
}

#chatbot-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#chatbot-input:disabled {
    background: #f7fafc;
    cursor: not-allowed;
}

#chatbot-send {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

#chatbot-send:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#chatbot-hint {
    font-size: 11px;
    color: #a0aec0;
    margin-top: 8px;
    text-align: center;
}

/* Toggle Button */
#chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    position: relative;
}

#chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.5);
}

#chatbot-toggle.active {
    transform: rotate(360deg) scale(0.9);
}

#chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #f56565;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    animation: bounce 2s infinite;
}

#chatbot-badge.active {
    display: flex;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #chatbot-widget {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    #chatbot-window {
        width: 100%;
        max-width: 100%;
        height: calc(100vh - 100px);
        max-height: 600px;
        bottom: 70px;
        right: 0;
        left: 0;
    }
    
    #chatbot-toggle {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    #chatbot-window {
        border-radius: 16px;
        height: calc(100vh - 90px);
    }
    
    #chatbot-header {
        padding: 16px;
        border-radius: 16px 16px 0 0;
    }
    
    #chatbot-header h3 {
        font-size: 16px;
    }
    
    #chatbot-messages {
        padding: 15px;
    }
    
    .chatbot-message-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* Print */
@media print {
    #chatbot-widget {
        display: none !important;
    }
}
