/**
 * Chatbot Widget Styles
 * Modern, responsive design with dark/light mode support
 */

/* Chatbot Widget Container */
.chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: 'Inter', sans-serif;
}

/* Chat Toggle Button */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(139, 92, 246, 0.4);
}

.chatbot-toggle:active {
    transform: translateY(0);
}

.chatbot-icon {
    width: 24px;
    height: 24px;
    color: white;
    transition: transform 0.3s ease;
}

.chatbot-toggle:hover .chatbot-icon {
    transform: scale(1.1);
}

/* Pulse Animation */
.chatbot-pulse {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: #10B981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Chat Container */
.chatbot-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: var(--color-bg-primary, #1F2937);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chatbot-widget.open .chatbot-container {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.chatbot-header {
    padding: 20px;
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

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

.chatbot-avatar svg {
    width: 20px;
    height: 20px;
    color: white;
}

.chatbot-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}

.chatbot-info p {
    margin: 4px 0 0 0;
    font-size: 12px;
    opacity: 0.9;
    line-height: 1.3;
}

.chatbot-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

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

.chatbot-close svg {
    width: 14px;
    height: 14px;
    color: white;
}

/* Messages Container */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

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

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--color-border, rgba(255, 255, 255, 0.2));
    border-radius: 2px;
}

/* Message Styles */
.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: messageSlideIn 0.3s ease;
}

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

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.bot-message {
    align-self: flex-start;
}

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

.user-message .message-avatar {
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
}

.bot-message .message-avatar {
    background: var(--color-accent-secondary, #374151);
}

.message-avatar svg {
    width: 16px;
    height: 16px;
    color: white;
}

.message-content {
    background: var(--color-bg-secondary, #374151);
    padding: 12px 16px;
    border-radius: 18px;
    color: var(--color-text-primary, #F9FAFB);
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.user-message .message-content {
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
    color: white;
}

.message-content p {
    margin: 0 0 8px 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul {
    margin: 8px 0;
    padding-left: 16px;
}

.message-content li {
    margin-bottom: 4px;
}

.message-content code {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 12px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--color-bg-secondary, #374151);
    border-radius: 18px;
    color: var(--color-text-secondary, #9CA3AF);
    font-size: 12px;
    max-width: 120px;
    animation: messageSlideIn 0.3s ease;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--color-text-secondary, #9CA3AF);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Input Container */
.chatbot-input-container {
    padding: 20px;
    border-top: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
    background: var(--color-bg-primary, #1F2937);
}

.chatbot-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.2));
    border-radius: 24px;
    background: var(--color-bg-secondary, #374151);
    color: var(--color-text-primary, #F9FAFB);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.chatbot-input:focus {
    border-color: #8B5CF6;
}

.chatbot-input::placeholder {
    color: var(--color-text-secondary, #9CA3AF);
}

.chatbot-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chatbot-send:hover {
    transform: scale(1.05);
}

.chatbot-send:active {
    transform: scale(0.95);
}

.chatbot-send svg {
    width: 16px;
    height: 16px;
    color: white;
}

/* Responsive Design */
@media (max-width: 480px) {
    .chatbot-container {
        width: calc(100vw - 40px);
        height: 60vh;
        bottom: 80px;
        right: 0;
    }
    
    .chatbot-widget {
        bottom: 20px;
        right: 20px;
    }
    
    .message {
        max-width: 90%;
    }
}

/* Dark/Light Mode Support */
[data-theme="light"] .chatbot-container {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .message-content {
    background: #F3F4F6;
    color: #1F2937;
}

[data-theme="light"] .bot-message .message-avatar {
    background: #6B7280;
}

[data-theme="light"] .chatbot-input {
    background: #F9FAFB;
    border-color: #D1D5DB;
    color: #1F2937;
}

[data-theme="light"] .chatbot-input::placeholder {
    color: #6B7280;
}

[data-theme="light"] .typing-indicator {
    background: #F3F4F6;
    color: #6B7280;
}

[data-theme="light"] .typing-dots span {
    background: #6B7280;
}

[data-theme="light"] .chatbot-input-container {
    background: #FFFFFF;
    border-top-color: #E5E7EB;
}

/* Accessibility */
.chatbot-toggle:focus,
.chatbot-close:focus,
.chatbot-send:focus,
.chatbot-input:focus {
    outline: 2px solid #8B5CF6;
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .chatbot-toggle,
    .chatbot-container,
    .message,
    .typing-dots span {
        animation: none;
        transition: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .chatbot-container {
        border: 2px solid var(--color-text-primary);
    }

    .message-content {
        border: 1px solid var(--color-text-primary);
    }
}

/* Quick Questions */
.quick-questions {
    margin: 12px 0;
}

.quick-questions p {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text-primary);
    font-size: 0.85rem;
}

.quick-question-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--color-accent-primary), var(--color-accent-secondary));
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
    margin: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    line-height: 1.2;
}

.quick-question-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.quick-question-btn:active {
    transform: translateY(0);
}

/* Mobile responsive quick questions */
@media (max-width: 768px) {
    .quick-question-btn {
        padding: 4px 8px;
        font-size: 0.7rem;
        margin: 2px;
    }
} 