/* Chatbot Styles */

/* Floating Chat Button */
.chat-button {
    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 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 9999;
    border: none;
}
.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.chat-button svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.chat-button.active {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 400px;
    max-width: calc(100vw - 60px);
    height: 600px;
    max-height: calc(100vh - 140px);
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
    animation: slideUp 0.3s ease-out;
}

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

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

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

.chat-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-header-icon svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.chat-header-text h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.chat-header-text p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.chat-close:hover {
    transform: rotate(90deg);
}

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

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

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

.chat-message.bot {
    flex-direction: row;
}

.chat-message.user {
    flex-direction: row-reverse;
}

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

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

.message-avatar.user {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.message-avatar svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 0.95rem;
}

.chat-message.bot .message-content {
    background: white;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}

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

/* Message Blocks */
.message-block {
    margin-top: 12px;
    padding: 12px;
    background: #f3f4f6;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.message-block h4 {
    margin: 0 0 8px 0;
    font-size: 0.95rem;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 6px;
}

.message-block p {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    color: #4b5563;
}

.message-block a {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: background 0.2s ease;
}

.message-block a:hover {
    background: #5568d3;
}

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

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

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

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
}

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

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

.chat-send-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

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

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

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

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

.quick-action {
    padding: 8px 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #667eea;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-action:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Error Message */
.error-message {
    padding: 12px;
    background: #fef2f2;
    border-left: 3px solid #ef4444;
    border-radius: 8px;
    color: #991b1b;
    font-size: 0.9rem;
    margin-top: 8px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .chat-window {
        bottom: 82px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
        max-height: calc(100vh - 150px);
    }

    .chat-button {
        bottom: 18px;
        right: 16px;
        width: 54px;
        height: 54px;
    }

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

@media (max-width: 480px) {
    .chat-window {
        bottom: 78px;
        right: 8px;
        left: 8px;
        max-height: calc(100vh - 150px);
    }

    .chat-button {
        bottom: 16px;
        right: 12px;
        width: 50px;
        height: 50px;
    }
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

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

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

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
