/* AI Chatbot Styles */
.ai-chat-widget {
    position: fixed;
    bottom: 100px;
    left: 30px;
    z-index: 9998;
}

.chat-toggle-btn {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(139, 69, 19, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: chatPulse 2s infinite;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(139, 69, 19, 0.6);
}

@keyframes chatPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.chat-window {
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.chat-header {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
    padding: 20px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.chat-header-content i {
    font-size: 32px;
}

.chat-header-content h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.chat-header-content .status {
    font-size: 0.85rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-header-content .status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #27ae60;
    border-radius: 50%;
    display: inline-block;
    animation: statusBlink 2s infinite;
}

@keyframes statusBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

.chat-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #8B4513;
    border-radius: 3px;
}

.bot-message,
.user-message {
    display: flex;
    gap: 10px;
    animation: messageSlide 0.3s ease;
}

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

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

.message-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 15px;
    max-width: 70%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-message .message-content {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
}

.message-content p {
    margin: 0;
    line-height: 1.5;
    font-size: 0.95rem;
}

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

.typing-indicator .message-content {
    padding: 16px;
}

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

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

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

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

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

.chat-input-area {
    padding: 15px;
    background: white;
    border-radius: 0 0 20px 20px;
    display: flex;
    gap: 10px;
    border-top: 1px solid #e0e0e0;
}

#chatInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

#chatInput:focus {
    border-color: #8B4513;
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

#chatSendBtn {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 16px;
}

#chatSendBtn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.4);
}

#chatSendBtn:active {
    transform: scale(0.95);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ai-chat-widget {
        bottom: 80px;
        left: 15px;
    }

    .chat-toggle-btn {
        width: 55px;
        height: 55px;
        font-size: 24px;
    }

    .chat-window {
        width: calc(100vw - 30px);
        height: calc(100vh - 150px);
        max-height: 500px;
        bottom: 70px;
    }

    .message-content {
        max-width: 80%;
    }
}

@media (max-width: 480px) {
    .chat-window {
        width: calc(100vw - 20px);
        left: -5px;
    }

    .chat-header {
        padding: 15px;
    }

    .chat-header-content h4 {
        font-size: 1rem;
    }

    .chat-messages {
        padding: 15px;
    }
}
