/* ============================================
   AI CHATBOT STYLES - ASKera Design
   Premium AI Design Assistant
   ============================================ */

:root {
    --chatbot-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --chatbot-secondary: #4f46e5;
    --chatbot-accent: #06b6d4;
    --chatbot-bg: #ffffff;
    --chatbot-user-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --chatbot-ai-bg: #f3f4f6;
    --chatbot-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    --chatbot-text: #1f2937;
    --chatbot-text-light: #6b7280;
}

/* Chatbot Toggle Button - Floating */
.chatbot-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: var(--chatbot-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--chatbot-shadow);
    z-index: 9998;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: pulse-glow 2s infinite;
}

.chatbot-toggle:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 50px rgba(102, 126, 234, 0.5);
}

.chatbot-toggle i {
    font-size: 28px;
    color: white;
    transition: transform 0.3s ease;
}

.chatbot-toggle.active i {
    transform: rotate(180deg);
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 10px 50px rgba(102, 126, 234, 0.6);
    }
}

/* Notification Badge */
.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border: 3px solid white;
    animation: bounce-in 0.5s ease;
}

@keyframes bounce-in {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 420px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 150px);
    background: var(--chatbot-bg);
    border-radius: 20px;
    box-shadow: var(--chatbot-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Chatbot Header */
.chatbot-header {
    background: var(--chatbot-primary);
    padding: 20px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chatbot-avatar {
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.chatbot-avatar::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border: 2px solid white;
    border-radius: 50%;
}

.chatbot-header-text h3 {
    margin: 0;
    color: white;
    font-size: 18px;
    font-weight: 700;
}

.chatbot-header-text p {
    margin: 2px 0 0 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
}

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

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

.chatbot-close i {
    color: white;
    font-size: 18px;
}

/* Chatbot Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    background: #fafafa;
    scroll-behavior: smooth;
}

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

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

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

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Message Bubble */
.message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: message-slide-in 0.4s ease;
}

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

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

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

.message.ai .message-avatar {
    background: var(--chatbot-primary);
    color: white;
}

.message.user .message-avatar {
    background: var(--chatbot-user-bg);
    color: white;
}

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

.message-bubble {
    padding: 14px 18px;
    border-radius: 18px;
    line-height: 1.6;
    font-size: 14.5px;
    word-wrap: break-word;
}

.message.ai .message-bubble {
    background: white;
    color: var(--chatbot-text);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.message.user .message-bubble {
    background: var(--chatbot-user-bg);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 11px;
    color: var(--chatbot-text-light);
    margin-top: 6px;
    padding: 0 5px;
}

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

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 14px 18px;
    background: white;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--chatbot-secondary);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite;
}

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

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

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

/* Quick Reply Buttons */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.quick-reply-btn {
    background: white;
    border: 2px solid var(--chatbot-secondary);
    color: var(--chatbot-secondary);
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.quick-reply-btn:hover {
    background: var(--chatbot-secondary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.quick-reply-btn i {
    font-size: 12px;
}

/* Chatbot Input Area */
.chatbot-input-area {
    padding: 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.chatbot-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.chatbot-input:focus {
    outline: none;
    border-color: var(--chatbot-secondary);
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.chatbot-send-btn {
    width: 48px;
    height: 48px;
    background: var(--chatbot-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chatbot-send-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

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

.chatbot-send-btn i {
    color: white;
    font-size: 18px;
}

/* Service Cards in Chat */
.service-card-chat {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-top: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.service-card-chat:hover {
    border-color: var(--chatbot-secondary);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
    transform: translateY(-2px);
}

.service-card-chat h4 {
    margin: 0 0 8px 0;
    color: var(--chatbot-text);
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.service-card-chat h4 i {
    color: var(--chatbot-secondary);
}

.service-card-chat p {
    margin: 0;
    color: var(--chatbot-text-light);
    font-size: 13px;
    line-height: 1.5;
}

.service-card-chat .price {
    margin-top: 10px;
    font-weight: 700;
    color: var(--chatbot-secondary);
    font-size: 14px;
}

/* Welcome Message Special Styling */
.welcome-message {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-left: 4px solid var(--chatbot-secondary);
    padding: 18px;
    border-radius: 12px;
    margin-bottom: 15px;
}

.welcome-message h4 {
    margin: 0 0 10px 0;
    color: var(--chatbot-text);
    font-size: 16px;
}

.welcome-message p {
    margin: 0;
    color: var(--chatbot-text-light);
    font-size: 14px;
    line-height: 1.6;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-toggle {
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
    }

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

    .chatbot-container {
        bottom: 95px;
        right: 20px;
        left: 20px;
        width: auto;
        max-width: none;
        height: 550px;
    }

    .chatbot-header {
        padding: 16px 20px;
    }

    .chatbot-avatar {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .chatbot-header-text h3 {
        font-size: 16px;
    }

    .chatbot-header-text p {
        font-size: 12px;
    }

    .chatbot-messages {
        padding: 20px 15px;
    }

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

    .message-bubble {
        padding: 12px 15px;
        font-size: 14px;
    }

    .chatbot-input-area {
        padding: 15px;
    }

    .chatbot-input {
        padding: 12px 16px;
        font-size: 14px;
    }

    .chatbot-send-btn {
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 480px) {
    .chatbot-container {
        bottom: 0;
        right: 0;
        left: 0;
        top: 0;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .chatbot-toggle {
        bottom: 15px;
        right: 15px;
    }
}

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

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Powered by Badge */
.chatbot-powered {
    text-align: center;
    padding: 10px;
    font-size: 11px;
    color: var(--chatbot-text-light);
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.chatbot-powered i {
    color: #ef4444;
    animation: heartbeat 1.5s infinite;
}

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