/* Eva - Chatbot Styling */
/* Accessibility: WCAG 2.1 AA Compliant */

#doc-ollie-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Trigger Button */
.ollie-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 102, 204, 0.4);
    transition: all 0.3s ease;
    font-size: 15px;
    font-weight: 500;
}

.ollie-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 102, 204, 0.5);
}

.ollie-trigger.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

.ollie-trigger-icon {
    font-size: 24px;
}

/* Chat Window */
.ollie-chat-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    overflow: hidden;
}

.ollie-chat-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header */
.ollie-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: white;
}

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

.ollie-title {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ollie-title strong {
    font-size: 16px;
}

.ollie-title span {
    font-size: 12px;
    opacity: 0.8;
}

.ollie-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: background 0.2s ease;
}

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

.ollie-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Messages */
.ollie-messages {
    padding: 20px;
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ollie-message {
    padding: 12px 16px;
    border-radius: 16px;
    max-width: 85%;
    line-height: 1.5;
    font-size: 14px;
    animation: messageIn 0.3s ease;
}

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

.ollie-message-ollie {
    background: #f0f4f8;
    color: #1a1a1a;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.ollie-message-user {
    background: #0066cc;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Options */
.ollie-options {
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ollie-option {
    background: white;
    border: 2px solid #e0e6ed;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    color: #1a1a1a;
    transition: all 0.2s ease;
}

.ollie-option:hover {
    border-color: #0066cc;
    background: #f0f7ff;
    color: #0066cc;
}

.ollie-option:focus-visible {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
    border-color: #0066cc;
    background: #f0f7ff;
}

.ollie-trigger:focus-visible {
    outline: 3px solid #ffd700;
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(255, 215, 0, 0.3);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #doc-ollie-widget {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }

    .ollie-trigger {
        width: 100%;
        justify-content: center;
    }

    .ollie-chat-window {
        width: 100%;
        max-width: none;
        right: 0;
        left: 0;
        bottom: 60px;
        border-radius: 16px 16px 0 0;
    }

    .ollie-trigger-text {
        display: inline;
    }
}

/* Hide on very small screens or when other elements might overlap */
@media (max-width: 360px) {
    .ollie-trigger-text {
        display: none;
    }

    .ollie-trigger {
        width: 56px;
        height: 56px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }
}

/* Scrollbar styling */
.ollie-messages::-webkit-scrollbar {
    width: 6px;
}

.ollie-messages::-webkit-scrollbar-track {
    background: #f0f4f8;
    border-radius: 3px;
}

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

.ollie-messages::-webkit-scrollbar-thumb:hover {
    background: #a0a8b0;
}
