/* Chatbot Styles */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Dark mode styles */
body.dark-mode .chatbot-container {
    filter: invert(1) hue-rotate(180deg);
}

body.dark-mode .chatbot-window {
    background: #1a1a1a;
    border: 1px solid #333;
}

body.dark-mode .chatbot-header {
    background: linear-gradient(135deg, #b40000, #8b0000);
}

body.dark-mode .chatbot-messages {
    background: #2a2a2a;
}

body.dark-mode .chatbot-message-content {
    background: #333;
    color: #fff;
}

body.dark-mode .chatbot-message.user .chatbot-message-content {
    background: linear-gradient(135deg, #b40000, #8b0000);
    color: white;
}

body.dark-mode .chatbot-input-container {
    background: #1a1a1a;
    border-top: 1px solid #333;
}

body.dark-mode .chatbot-input {
    background: #2a2a2a;
    border: 1px solid #555;
    color: #fff;
}

body.dark-mode .chatbot-input:focus {
    border-color: #b40000;
}

body.dark-mode .chatbot-message.user .chatbot-avatar {
    background: #444;
    color: #ccc;
}

/* Dark mode toggle button */
.dark-mode-toggle {
    position: fixed;
    top: 20px;
    right: 90px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #333, #555);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 9998;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.dark-mode-toggle svg {
    width: 20px;
    height: 20px;
    fill: white;
}

body.dark-mode .dark-mode-toggle {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e88ff, #0f6ad8);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(30, 136, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(30, 136, 255, 0.4);
}

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

.chatbot-toggle.active {
    background: linear-gradient(135deg, #b40000, #8b0000);
}

.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

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

.chatbot-header {
    background: linear-gradient(135deg, #1e88ff, #0f6ad8);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

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

.chatbot-message {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    animation: messageSlide 0.3s ease;
}

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

.chatbot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e88ff, #0f6ad8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
    flex-shrink: 0;
}

.chatbot-message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 80%;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
}

.chatbot-message.user .chatbot-message-content {
    background: linear-gradient(135deg, #1e88ff, #0f6ad8);
    color: white;
    margin-left: auto;
}

.chatbot-message.user .chatbot-avatar {
    background: #e0e0e0;
    color: #666;
}

.chatbot-input-container {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input:focus {
    border-color: #1e88ff;
}

.chatbot-send {
    background: linear-gradient(135deg, #1e88ff, #0f6ad8);
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chatbot-send:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(30, 136, 255, 0.3);
}

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

.chatbot-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: #e0e0e0;
    border-radius: 12px;
    width: fit-content;
}

.chatbot-typing-dot {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    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);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 40px);
        height: 60vh;
        right: -10px;
        bottom: 70px;
    }
    
    .chatbot-toggle {
        width: 50px;
        height: 50px;
        right: 15px;
        bottom: 15px;
    }
}
