/* SignSpeak AI Chatbot Styles */

:root {
    --chatbot-primary: #06BBCC;
    --chatbot-primary-dark: #059aa8;
    --chatbot-primary-light: #e8f9fb;
    --chatbot-bg: #ffffff;
    --chatbot-text: #2d3748;
    --chatbot-text-light: #718096;
    --chatbot-border: #e2e8f0;
    --chatbot-shadow: 0 10px 40px rgba(6, 187, 204, 0.2);
    --chatbot-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Floating Chat Button */
.chatbot-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-primary-dark) 100%);
    border: none;
    cursor: pointer;
    box-shadow: var(--chatbot-shadow);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: chatbot-pulse 2s infinite;
}

.chatbot-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 48px rgba(6, 187, 204, 0.35);
}

.chatbot-trigger:active {
    transform: scale(0.95);
}

.chatbot-trigger i {
    font-size: 28px;
    color: white;
    transition: transform 0.3s ease;
}

.chatbot-trigger.active i {
    transform: rotate(90deg);
}

.chatbot-trigger .chatbot-icon-chat,
.chatbot-trigger.active .chatbot-icon-close {
    display: block;
}

.chatbot-trigger .chatbot-icon-close,
.chatbot-trigger.active .chatbot-icon-chat {
    display: none;
}

@keyframes chatbot-pulse {
    0%, 100% {
        box-shadow: 0 10px 40px rgba(6, 187, 204, 0.2);
    }
    50% {
        box-shadow: 0 10px 40px rgba(6, 187, 204, 0.4);
    }
}

/* Chat Window */
.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    height: 520px;
    background: var(--chatbot-bg);
    border-radius: 20px;
    box-shadow: var(--chatbot-shadow);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.chatbot-header {
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-primary-dark) 100%);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-avatar {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.chatbot-header-info {
    flex: 1;
}

.chatbot-header-title {
    color: white;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 15px;
    margin: 0;
}

.chatbot-header-status {
    color: rgba(255, 255, 255, 0.85);
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 1px;
}

.chatbot-status-dot {
    width: 6px;
    height: 6px;
    background: #48bb78;
    border-radius: 50%;
    animation: status-pulse 1.5s infinite;
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 14px;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Messages Container */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: linear-gradient(180deg, #f8fcfd 0%, #ffffff 100%);
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--chatbot-border);
    border-radius: 3px;
}

/* Message Bubbles */
.chatbot-message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: message-fade-in 0.3s ease;
}

@keyframes message-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chatbot-message.assistant {
    align-self: flex-start;
}

.chatbot-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.chatbot-message.assistant .chatbot-message-avatar {
    background: var(--chatbot-primary-light);
    color: var(--chatbot-primary);
}

.chatbot-message.user .chatbot-message-avatar {
    background: #edf2f7;
    color: var(--chatbot-text-light);
}

.chatbot-message-content {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    font-family: 'Nunito', sans-serif;
}

.chatbot-message.assistant .chatbot-message-content {
    background: white;
    color: var(--chatbot-text);
    border: 1px solid var(--chatbot-border);
    border-bottom-left-radius: 6px;
}

.chatbot-message.user .chatbot-message-content {
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-primary-dark) 100%);
    color: white;
    border-bottom-right-radius: 6px;
}

/* Typing Indicator */
.chatbot-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border: 1px solid var(--chatbot-border);
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    width: fit-content;
}

.chatbot-typing span {
    width: 8px;
    height: 8px;
    background: var(--chatbot-primary);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out;
}

.chatbot-typing span:nth-child(1) { animation-delay: 0s; }
.chatbot-typing span:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* Quick Actions */
.chatbot-quick-actions {
    padding: 6px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    border-top: 1px solid var(--chatbot-border);
    background: #fafcfd;
}

.chatbot-quick-btn {
    background: white;
    border: 1px solid var(--chatbot-border);
    padding: 5px 10px;
    border-radius: 14px;
    font-size: 11px;
    color: var(--chatbot-text);
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
}

.chatbot-quick-btn i {
    font-size: 10px;
    margin-right: 3px;
}

.chatbot-quick-btn:hover {
    background: var(--chatbot-primary-light);
    border-color: var(--chatbot-primary);
    color: var(--chatbot-primary);
}

/* Input Area */
.chatbot-input-area {
    padding: 10px 12px;
    border-top: 1px solid var(--chatbot-border);
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: white;
}

.chatbot-input-wrapper {
    flex: 1;
    position: relative;
}

.chatbot-input {
    width: 100%;
    border: 2px solid var(--chatbot-border);
    border-radius: 20px;
    padding: 10px 14px;
    font-size: 13px;
    font-family: 'Nunito', sans-serif;
    resize: none;
    max-height: 80px;
    transition: border-color 0.2s;
    outline: none;
}

.chatbot-input:focus {
    border-color: var(--chatbot-primary);
}

.chatbot-input::placeholder {
    color: var(--chatbot-text-light);
}

.chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-primary-dark) 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chatbot-send:hover {
    transform: scale(1.05);
    box-shadow: var(--chatbot-shadow-sm);
}

.chatbot-send:disabled {
    background: var(--chatbot-border);
    cursor: not-allowed;
    transform: none;
}

.chatbot-send i {
    font-size: 16px;
}

/* Welcome Message */
.chatbot-welcome {
    text-align: center;
    padding: 20px;
}

.chatbot-welcome-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.chatbot-welcome h4 {
    color: var(--chatbot-text);
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    margin-bottom: 8px;
}

.chatbot-welcome p {
    color: var(--chatbot-text-light);
    font-size: 14px;
    margin: 0;
}

/* Error State */
.chatbot-error {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatbot-error i {
    color: #e53e3e;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chatbot-window {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-height: 100vh;
        max-height: 100dvh;
    }

    .chatbot-trigger {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }

    .chatbot-trigger i {
        font-size: 24px;
    }

    .chatbot-header {
        padding: 10px 12px;
        border-radius: 0;
    }

    .chatbot-messages {
        padding: 12px;
    }

    .chatbot-quick-actions {
        padding: 6px 10px;
    }

    .chatbot-input-area {
        padding: 8px 10px;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
}

/* Tablet */
@media (min-width: 481px) and (max-width: 768px) {
    .chatbot-window {
        width: 360px;
        height: 480px;
    }
}

/* Prevent body scroll when chat is open on mobile */
body.chatbot-open {
    overflow: hidden;
}

@media (min-width: 481px) {
    body.chatbot-open {
        overflow: auto;
    }
}

/* Link styling in messages */
.chatbot-message-content a {
    color: var(--chatbot-primary);
    text-decoration: underline;
}

.chatbot-message.user .chatbot-message-content a {
    color: white;
}

/* Code/highlight styling */
.chatbot-message-content code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
}

.chatbot-message.user .chatbot-message-content code {
    background: rgba(255, 255, 255, 0.2);
}

/* Notification badge */
.chatbot-notification {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: #e53e3e;
    border-radius: 50%;
    color: white;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    animation: notification-pop 0.3s ease;
}

@keyframes notification-pop {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

/* Accessibility */
.chatbot-trigger:focus,
.chatbot-close:focus,
.chatbot-send:focus,
.chatbot-quick-btn:focus {
    outline: 2px solid var(--chatbot-primary);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .chatbot-trigger,
    .chatbot-window,
    .chatbot-message,
    .chatbot-typing span {
        animation: none;
        transition: opacity 0.2s;
    }
}

