/* Chat Widget Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-600, #4f46e5) 0%, var(--accent-600, #7c3aed) 100%);
    border: none;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: white;
    font-size: 20px;
    position: relative;
    overflow: hidden;
}

.chat-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chat-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(79, 70, 229, 0.4);
}

.chat-toggle:hover::before {
    opacity: 1;
}

.chat-toggle svg {
    position: relative;
    z-index: 1;
}

.chat-toggle.active {
    background: linear-gradient(135deg, #e11d48, #dc2626);
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chat-window.open {
    display: flex;
}

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

.chat-header {
    background: linear-gradient(135deg, var(--primary-600, #4f46e5) 0%, var(--accent-600, #7c3aed) 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 16px 16px 0 0;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-header p {
    margin: 4px 0 0 0;
    font-size: 13px;
    opacity: 0.9;
}

.chat-status {
    display: flex;
    align-items: center;
    margin-top: 8px;
    font-size: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    margin-right: 6px;
    animation: pulse 2s infinite;
}

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

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f9fafb;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.message {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
}

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

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

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

.message.bot .message-avatar {
    background: linear-gradient(135deg, var(--primary-600, #4f46e5) 0%, var(--accent-600, #7c3aed) 100%);
    color: white;
}

.message.user .message-avatar {
    background: #e5e7eb;
    color: #6b7280;
    order: 2;
    margin-right: 0;
    margin-left: 8px;
}

.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
}

.message.bot .message-content {
    background: white;
    color: #374151;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--primary-600, #4f46e5) 0%, var(--accent-600, #7c3aed) 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-input-container {
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    background: white;
}

.chat-input-form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    resize: none;
    outline: none;
    max-height: 80px;
    min-height: 40px;
    transition: border-color 0.2s;
}

.chat-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.chat-input:focus {
    border-color: var(--primary-500, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-600, #4f46e5) 0%, var(--accent-600, #7c3aed) 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.chat-send-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.typing-indicator {
    display: none;
    align-items: center;
    margin-bottom: 16px;
}

.typing-indicator.show {
    display: flex;
}

.typing-dots {
    display: flex;
    gap: 3px;
    margin-left: 8px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9ca3af;
    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% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.quick-action {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-action:hover {
    background: var(--primary-50, #eff6ff);
    border-color: var(--primary-200, #bfdbfe);
    color: var(--primary-700, #1d4ed8);
}

/* Hide chat widget at high zoom levels (151% and above) */
@media (max-width: 860px) {
    .chat-widget {
        display: none;
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chat-widget {
        bottom: 15px;
        right: 15px;
        display: block; /* Re-enable for mobile devices */
    }
    
    .chat-window {
        width: calc(100vw - 30px);
        height: calc(100vh - 120px);
        max-height: calc(100vh - 120px);
        bottom: 80px;
        right: -15px;
        border-radius: 16px;
    }
    
    .chat-toggle {
        width: 55px;
        height: 55px;
        font-size: 22px;
    }
}