/* Chatbot Widget Styles */
.chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
}

/* Chat Toggle Button */
.chat-toggle-btn {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary, #667eea) 0%, var(--secondary, #764ba2) 100%);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.6);
}

.chat-toggle-btn:active {
    transform: scale(0.95);
}

.chat-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    border: 2px solid var(--bg-primary, #0a0e27);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: var(--bg-secondary, #1a1a2e);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideUp 0.3s ease;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.chat-window.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

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

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, var(--primary, #667eea) 0%, var(--secondary, #764ba2) 100%);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-header-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

.chat-title h3 {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.chat-status {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chat-header-actions {
    display: flex;
    gap: 0.5rem;
}

.chat-action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--bg-primary, #0a0e27);
}

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

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Welcome Message */
.chat-welcome {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary, #94a3b8);
}

.welcome-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary, #667eea) 0%, var(--secondary, #764ba2) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
}

.chat-welcome h4 {
    color: var(--text-primary, #e2e8f0);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.chat-welcome p {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Chat Suggestions */
.chat-suggestions {
    margin-top: 1rem;
}

.suggestions-title {
    color: var(--text-muted, #64748b);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.suggestions-grid {
    display: grid;
    gap: 0.5rem;
}

.suggestion-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.875rem;
}

.suggestion-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary, #667eea);
    transform: translateX(4px);
}

.suggestion-chip.priority {
    border-color: var(--warning, #ef4444);
    background: rgba(239, 68, 68, 0.1);
}

.suggestion-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* Chat Messages */
.chat-message {
    display: flex;
    animation: fadeIn 0.3s ease;
}

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

.message-content {
    display: flex;
    gap: 0.75rem;
    max-width: 85%;
}

.bot-message .message-content {
    margin-right: auto;
}

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

.user-message .message-content {
    margin-left: auto;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.bot-message .message-avatar {
    background: linear-gradient(135deg, var(--primary, #667eea) 0%, var(--secondary, #764ba2) 100%);
    color: white;
}

.user-message .message-avatar {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #e2e8f0);
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    line-height: 1.5;
}

.bot-message .message-bubble {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top-left-radius: 4px;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, var(--primary, #667eea) 0%, var(--secondary, #764ba2) 100%);
    border-top-right-radius: 4px;
}

.message-text {
    color: var(--text-primary, #e2e8f0);
    font-size: 0.9rem;
    word-wrap: break-word;
}

.message-text ul {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
}

.message-text li {
    margin: 0.25rem 0;
}

.message-text strong {
    font-weight: 600;
    color: white;
}

.message-time {
    font-size: 0.7rem;
    color: var(--text-muted, #64748b);
    margin-top: 0.25rem;
    text-align: right;
}

.user-message .message-time {
    color: rgba(255, 255, 255, 0.7);
}

/* Typing Indicator */
.typing-indicator .message-bubble {
    padding: 0.75rem 1.25rem;
}

.typing-dots {
    display: flex;
    gap: 0.5rem;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary, #667eea);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

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

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

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

/* Chat Input */
.chat-input-container {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--bg-secondary, #1a1a2e);
    padding: 1rem;
}

.chat-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: var(--text-primary, #e2e8f0);
    font-size: 0.9rem;
    resize: none;
    max-height: 120px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary, #667eea);
    background: rgba(255, 255, 255, 0.08);
}

.chat-input::placeholder {
    color: var(--text-muted, #64748b);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary, #667eea) 0%, var(--secondary, #764ba2) 100%);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

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

.chat-input-hint {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

    .chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 70px;
        right: -10px;
    }

    .chat-toggle-btn {
        width: 56px;
        height: 56px;
        font-size: 1.25rem;
    }
}
