/* ================================
   🤖 AI CHATBOT - TIXXEY
   ================================ */

/* Chatbot Button */
.chatbot-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    border: none;
    animation: pulse-glow 2s infinite;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(139, 92, 246, 0.6);
}

.chatbot-button.active {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
}

.chatbot-button svg {
    width: 28px;
    height: 28px;
    color: white;
    transition: transform 0.3s ease;
}

.chatbot-button.active svg {
    transform: rotate(180deg);
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
    }

    50% {
        box-shadow: 0 8px 32px rgba(139, 92, 246, 0.6), 0 0 0 8px rgba(139, 92, 246, 0.1);
    }
}

/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 400px;
    max-width: calc(100vw - 48px);
    height: 600px;
    max-height: calc(100vh - 150px);
    background: #1A1A1A;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(139, 92, 246, 0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9998;
    overflow: hidden;
}

.chatbot-container.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Chatbot Header */
.chatbot-header {
    background: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 100%);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chatbot-avatar svg {
    width: 24px;
    height: 24px;
    color: white;
}

.chatbot-header-info {
    flex: 1;
}

.chatbot-header-title {
    font-size: 16px;
    font-weight: 700;
    color: white;
    margin: 0;
}

.chatbot-header-status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #10B981;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Chatbot Messages */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #0F0F0F;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.5);
}

/* Message Bubble */
.message {
    display: flex;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.message.bot .message-avatar {
    background: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 100%);
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #3B82F6 0%, #60A5FA 100%);
}

.message-content {
    max-width: 75%;
    background: #262626;
    padding: 12px 16px;
    border-radius: 16px;
    color: #E5E5E5;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.user .message-content {
    background: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.bot .message-content {
    border-bottom-left-radius: 4px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #8B5CF6;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.7;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Recommendation Cards */
.recommendation-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.recommendation-card {
    background: #1A1A1A;
    border: 1px solid #333;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.recommendation-card:hover {
    border-color: #8B5CF6;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(139, 92, 246, 0.2);
}

.recommendation-card-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    background: #262626;
}

.recommendation-card-content {
    padding: 12px;
}

.recommendation-card-title {
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin: 0 0 4px 0;
}

.recommendation-card-details {
    font-size: 12px;
    color: #999;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recommendation-card-detail {
    display: flex;
    align-items: center;
    gap: 6px;
}

.recommendation-card-detail svg {
    width: 14px;
    height: 14px;
    color: #8B5CF6;
}

/* Quick Suggestions */
.quick-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.quick-suggestion {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #A78BFA;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-suggestion:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: #8B5CF6;
    transform: translateY(-1px);
}

/* Chatbot Input */
.chatbot-input-container {
    padding: 16px;
    background: #1A1A1A;
    border-top: 1px solid #333;
}

.chatbot-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chatbot-input {
    flex: 1;
    background: #262626;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 12px 16px;
    color: white;
    font-size: 14px;
    resize: none;
    max-height: 120px;
    min-height: 44px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.chatbot-input:focus {
    outline: none;
    border-color: #8B5CF6;
}

.chatbot-input::placeholder {
    color: #666;
}

.chatbot-send-button {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 100%);
    border: none;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chatbot-send-button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.chatbot-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chatbot-send-button svg {
    width: 20px;
    height: 20px;
    color: white;
}

/* Voice Button */
.chatbot-voice-button {
    width: 44px;
    height: 44px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chatbot-voice-button:hover:not(:disabled) {
    background: rgba(139, 92, 246, 0.2);
    border-color: #8B5CF6;
    transform: scale(1.05);
}

.chatbot-voice-button.listening {
    background: linear-gradient(135deg, #EF4444 0%, #F87171 100%);
    border-color: #EF4444;
    animation: pulse-mic 1.5s infinite;
}

.chatbot-voice-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.chatbot-voice-button svg {
    width: 20px;
    height: 20px;
    color: #A78BFA;
    transition: color 0.2s ease;
}

.chatbot-voice-button.listening svg {
    color: white;
}

@keyframes pulse-mic {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 40px 20px;
}

.welcome-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.welcome-icon svg {
    width: 32px;
    height: 32px;
    color: white;
}

.welcome-title {
    font-size: 18px;
    font-weight: 700;
    color: white;
    margin: 0 0 8px 0;
}

.welcome-subtitle {
    font-size: 14px;
    color: #999;
    margin: 0 0 20px 0;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .chatbot-container {
        bottom: 90px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
        height: calc(100vh - 120px);
    }

    .chatbot-button {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }

    .chatbot-button svg {
        width: 24px;
        height: 24px;
    }
}

/* Error State */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #FCA5A5;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}