/* Elite VIP Travel - AI Chat Assistant Styles */

/* ===== CHAT BUTTON ===== */
#chat-button {
    position: fixed;
    bottom: 120px;
    right: 40px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1e3a8a, #d4af37);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(30, 58, 138, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
    animation: pulse-chat 3s infinite;
}

#chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 30px rgba(30, 58, 138, 0.4);
}

#chat-button i {
    color: white;
    font-size: 24px;
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

@keyframes pulse-chat {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* ===== CHAT WINDOW ===== */
#chat-window {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 400px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 1001;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

#chat-window.open {
    display: flex;
    animation: slideUp 0.3s ease-out;
}

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

/* ===== CHAT HEADER ===== */
.chat-header {
    background: linear-gradient(135deg, #1e3a8a, #0f172a);
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #d4af37;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.chat-title i {
    font-size: 1.2rem;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.chat-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* ===== CHAT MESSAGES ===== */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #f8fafc;
}

.message {
    display: flex;
    gap: 0.75rem;
    max-width: 85%;
}

.assistant-message {
    align-self: flex-start;
}

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

.message-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.875rem;
    overflow: hidden;
    border: 2px solid #d4af37;
}

.assistant-message .message-avatar {
    background: linear-gradient(135deg, #1e3a8a, #0f172a);
    color: #d4af37;
    border: 1px solid #d4af37;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #d4af37, #f7e98e);
    color: #1e3a8a;
}

.message-content {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    line-height: 1.5;
    font-size: 0.875rem;
}

.user-message .message-content {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.message-time {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
    text-align: right;
}

/* ===== TYPING INDICATOR ===== */
.chat-typing {
    padding: 0.5rem 1rem;
    font-style: italic;
    color: #64748b;
    font-size: 0.875rem;
}

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

.typing-dots span {
    width: 4px;
    height: 4px;
    background: #64748b;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* ===== MR. ELITE AVATAR ===== */
.mr-elite-avatar {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50%;
    border: 2px solid #d4af37;
    object-fit: cover;
    object-position: center;
}

.message-avatar-img {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50%;
    border: 2px solid #d4af37;
    object-fit: cover;
    object-position: center;
}

.chat-button-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid #d4af37;
    object-fit: cover;
    object-position: center;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

/* ===== CHAT INPUT ===== */
.chat-input-area {
    padding: 1rem;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.chat-input-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    outline: none;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

#chat-input:focus {
    border-color: #3b82f6;
}

#chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#chat-send:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

#chat-send:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    #chat-button {
        bottom: 100px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    #chat-button i {
        font-size: 20px;
    }
    
    #chat-window {
        bottom: 20px;
        right: 20px;
        left: 20px;
        width: auto;
        height: 400px;
    }
    
    .message {
        max-width: 90%;
    }
}

/* ===== RTL SUPPORT ===== */
[dir="rtl"] .message {
    direction: rtl;
}

[dir="rtl"] .assistant-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

[dir="rtl"] .user-message {
    align-self: flex-start;
    flex-direction: row;
}

[dir="rtl"] .chat-title {
    flex-direction: row-reverse;
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    #chat-button,
    #chat-window,
    .typing-dots span {
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    #chat-window {
        border: 2px solid #000;
    }
    
    .message-content {
        border: 1px solid #000;
    }
}