/**
 * Chatbot Widget Styles
 * Matches Europa project theme with #10cfbd primary color
 */

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

/* Toggle Button */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0047ab 0%, #003d99 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 71, 171, 0.4);
    transition: all 0.3s ease;
    position: relative;
}

.chatbot-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 71, 171, 0.5);
}

.chatbot-toggle i {
    font-size: 28px;
}

.chatbot-toggle-active {
    background: linear-gradient(135deg, #626262 0%, #3b4752 100%);
}

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #f44336;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 550px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (max-width: 480px) {
    .chatbot-window {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    #chatbot-widget {
        bottom: 0;
        right: 0;
    }
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #0047ab 0%, #003d99 100%);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.chatbot-header-content i {
    font-size: 24px;
}

.chatbot-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.chatbot-header-actions {
    display: flex;
    gap: 8px;
}

.chatbot-clear-history,
.chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

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

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

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

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

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #0047ab;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #003d99;
}

/* Message */
.chatbot-message {
    display: flex;
    gap: 12px;
    animation: messageSlideIn 0.3s ease;
}

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

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

.chatbot-message-bot .chatbot-message-avatar {
    background: linear-gradient(135deg, #0047ab 0%, #003d99 100%);
    color: #fff;
}

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

.chatbot-message-user .chatbot-message-avatar {
    background: linear-gradient(135deg, #626262 0%, #3b4752 100%);
    color: #fff;
}

.chatbot-message-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chatbot-message-text {
    background: #fff;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 14px;
    color: #333;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
}

.chatbot-message-user .chatbot-message-text {
    background: linear-gradient(135deg, #0047ab 0%, #003d99 100%);
    color: #fff;
}

.chatbot-message-error .chatbot-message-text {
    background: #ffebee;
    color: #c62828;
    border-left: 3px solid #f44336;
}

.chatbot-message-time {
    font-size: 11px;
    color: #999;
    padding: 0 4px;
}

.chatbot-message-user .chatbot-message-time {
    text-align: right;
}

/* Typing Indicator */
.chatbot-typing-indicator .chatbot-message-content {
    max-width: 80px;
}

.chatbot-typing-dots {
    background: #fff;
    padding: 16px 20px;
    border-radius: 12px;
    display: flex;
    gap: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chatbot-typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0047ab;
    animation: typingDot 1.4s infinite ease-in-out;
}

.chatbot-typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

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

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

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Input Wrapper */
.chatbot-input-wrapper {
    background: #fff;
    padding: 16px 20px;
    border-top: 1px solid #e6e6e6;
}

.chatbot-input-container {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.chatbot-input {
    flex: 1;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.2s ease;
    min-height: 40px;
    max-height: 100px;
    line-height: 1.5;
}

.chatbot-input:focus {
    border-color: #0047ab;
    box-shadow: 0 0 0 2px rgba(0, 71, 171, 0.1);
}

.chatbot-input::placeholder {
    color: #999;
}

.chatbot-send-btn {
    background: linear-gradient(135deg, #0047ab 0%, #003d99 100%);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

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

.chatbot-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chatbot-send-btn i {
    font-size: 16px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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