/* ============================================
   ADNAN DEALS - AI CHATBOT STYLES
   Version: 2.0.0 (DRAGGABLE & RESIZABLE)
   Features: Chat Window, Bubbles, Animations, Drag & Drop, Resize
   ============================================ */

/* Chatbot Window - Draggable & Resizable */
.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    z-index: 1001;
    overflow: hidden;
    animation: chatbot-slideUp 0.3s ease;
    /* Resizable */
    resize: both;
    min-width: 280px;
    min-height: 400px;
    max-width: 90vw;
    max-height: 80vh;
}

.chatbot-window.active {
    display: flex;
}

/* Custom Resize Corner */
.chatbot-window::-webkit-resizer {
    background: linear-gradient(135deg, #1e3a8a, #f97316);
    border-radius: 0 0 12px 0;
    padding: 2px;
}

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

/* Chatbot Header - Drag Handle */
.chatbot-header {
    background: linear-gradient(135deg, #1e3a8a, #f97316);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
    position: relative;
    overflow: hidden;
}

/* Gradient Shine Effect */
.chatbot-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    animation: headerShine 8s infinite linear;
    pointer-events: none;
}

@keyframes headerShine {
    from { transform: translate(-30%, -30%) rotate(0deg); }
    to { transform: translate(30%, 30%) rotate(360deg); }
}

.chatbot-header h3 {
    font-size: 16px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.chatbot-header h3 i {
    font-size: 18px;
    animation: iconWiggle 3s infinite;
}

@keyframes iconWiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-8deg); }
    75% { transform: rotate(8deg); }
}

.close-chatbot {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
    z-index: 1;
}

.close-chatbot:hover {
    transform: scale(1.1);
}

/* Chatbot Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Custom Scrollbar for Messages */
.chatbot-messages::-webkit-scrollbar {
    width: 5px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 10px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #f97316;
    border-radius: 10px;
}

/* Message Bubbles */
.message {
    display: flex;
    margin-bottom: 8px;
    animation: message-fadeIn 0.3s ease;
}

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

.message.bot {
    justify-content: flex-start;
}

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

.message-content {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
}

.message.bot .message-content {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: #f1f5f9;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.message.user .message-content {
    background: linear-gradient(135deg, #1e3a8a, #f97316);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: #1e293b;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #f97316;
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out;
}

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

@keyframes typing-bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Quick Reply Buttons */
.quick-replies {
    padding: 10px 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid #e2e8f0;
    background: white;
}

.quick-reply-btn {
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: 30px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #1e293b;
}

.quick-reply-btn:hover {
    background: #f97316;
    color: white;
    border-color: #f97316;
    transform: translateY(-2px);
}

/* Chatbot Input Area */
.chatbot-input-area {
    display: flex;
    padding: 12px;
    border-top: 1px solid #e2e8f0;
    background: white;
    gap: 8px;
}

.chatbot-input-area input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 30px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.chatbot-input-area input:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249,115,22,0.15);
    outline: none;
}

.chatbot-input-area button {
    background: linear-gradient(135deg, #1e3a8a, #f97316);
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-input-area button:hover {
    transform: scale(1.05);
}

.chatbot-input-area button i {
    color: white;
    font-size: 18px;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .chatbot-window {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
        height: 450px;
        max-width: calc(100% - 40px);
    }
    
    .quick-reply-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .chatbot-input-area input {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .chatbot-input-area button {
        width: 38px;
        height: 38px;
    }
    
    .chatbot-input-area button i {
        font-size: 16px;
    }
}