/* Water Blob® AI Chatbot Styles */

/* Chat Toggle Button */
.chatbot-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0078ff, #00bbff);
    border: none;
    box-shadow: 0 4px 20px rgba(0, 120, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 9998;
}

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

.chatbot-toggle .chat-icon,
.chatbot-toggle .close-icon {
    width: 28px;
    height: 28px;
    color: white;
    transition: all 0.3s ease;
}

.chatbot-toggle .close-icon {
    position: absolute;
    opacity: 0;
    transform: rotate(90deg) scale(0);
}

.chatbot-toggle.open .chat-icon {
    opacity: 0;
    transform: rotate(-90deg) scale(0);
}

.chatbot-toggle.open .close-icon {
    opacity: 1;
    transform: rotate(0) scale(1);
}

.chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #10b981;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

/* Chat Window */
.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 600px;
    max-height: calc(100vh - 140px);
    background: var(--bg-card, #ffffff);
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9997;
    border: 1px solid var(--border-subtle, #e5e7eb);
}

.chatbot-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .chatbot-window {
        background: #1a1f2e;
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* Header */
.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #0078ff, #00bbff);
    border-radius: 16px 16px 0 0;
    color: white;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

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

.chatbot-title {
    font-weight: 600;
    font-size: 15px;
}

.chatbot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.9;
}

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

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

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

.chatbot-minimize:hover {
    background: rgba(255, 255, 255, 0.25);
}

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

/* Messages Container */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--bg-primary, #f9fafb);
}

@media (prefers-color-scheme: dark) {
    .chatbot-messages {
        background: #0a0e1a;
    }
}

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

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

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

@media (prefers-color-scheme: dark) {
    .chatbot-messages::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.2);
    }
}

/* Chat Messages */
.chat-message {
    display: flex;
    gap: 10px;
    animation: messageSlideIn 0.3s ease;
}

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

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

.message-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #0078ff, #00bbff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.message-content {
    flex: 1;
    max-width: 75%;
}

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

.message-text {
    background: white;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary, #1f2937);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
    .message-text {
        background: #1a1f2e;
        color: #e2e8f0;
    }
}

.user-message .message-text {
    background: linear-gradient(135deg, #0078ff, #00bbff);
    color: white;
}

.message-text ul {
    margin: 4px 0;
}

.message-text a {
    color: #0078ff;
    text-decoration: underline;
}

.user-message .message-text a {
    color: white;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
    .typing-indicator {
        background: #1a1f2e;
    }
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

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

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

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

/* Quick Questions */
.quick-questions {
    padding: 0 20px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-question {
    background: rgba(0, 120, 255, 0.1);
    border: 1px solid rgba(0, 120, 255, 0.2);
    color: #0078ff;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-question:hover {
    background: rgba(0, 120, 255, 0.15);
    border-color: rgba(0, 120, 255, 0.3);
    transform: translateY(-1px);
}

@media (prefers-color-scheme: dark) {
    .quick-question {
        background: rgba(0, 120, 255, 0.15);
        border-color: rgba(0, 120, 255, 0.3);
        color: #60a5fa;
    }
}

/* Input Container */
.chatbot-input-container {
    border-top: 1px solid var(--border-subtle, #e5e7eb);
    background: var(--bg-card, white);
    border-radius: 0 0 16px 16px;
}

@media (prefers-color-scheme: dark) {
    .chatbot-input-container {
        background: #1a1f2e;
        border-color: rgba(255, 255, 255, 0.1);
    }
}

.chatbot-input-form {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-subtle, #e5e7eb);
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    background: var(--bg-primary, #f9fafb);
    color: var(--text-primary, #1f2937);
}

.chatbot-input:focus {
    border-color: #0078ff;
    background: white;
}

@media (prefers-color-scheme: dark) {
    .chatbot-input {
        background: #0a0e1a;
        border-color: rgba(255, 255, 255, 0.1);
        color: #e2e8f0;
    }

    .chatbot-input:focus {
        background: #141824;
        border-color: #0078ff;
    }
}

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

.chatbot-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 120, 255, 0.3);
}

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

.chatbot-footer {
    padding: 0 20px 16px;
    text-align: center;
    font-size: 11px;
    color: var(--text-tertiary, #9ca3af);
}

.chatbot-footer a {
    color: #0078ff;
    text-decoration: none;
}

.chatbot-footer a:hover {
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-window {
        bottom: 90px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
        height: calc(100vh - 120px);
    }

    .chatbot-toggle {
        bottom: 16px;
        right: 16px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .chatbot-toggle,
    .chatbot-window,
    .chat-message {
        animation: none;
        transition: none;
    }

    .status-dot {
        animation: none;
    }
}
