/* AI Assistant Popup Styles */

/* Floating Chat Button */
.ai-chat-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--gradient-1);
    border: 3px solid var(--primary-color);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(240, 185, 11, 0.5);
    transition: all 0.3s ease;
    animation: pulse-glow 2s ease-in-out infinite;
}

.ai-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(240, 185, 11, 0.7);
}

.ai-chat-button span {
    font-size: 2.5rem;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 8px 30px rgba(240, 185, 11, 0.5);
    }
    50% {
        box-shadow: 0 12px 40px rgba(240, 185, 11, 0.8);
    }
}

/* Chat Popup Container */
.ai-chat-popup {
    position: fixed;
    bottom: 140px;
    right: 30px;
    width: 550px;
    height: 800px;
    background: var(--card-bg);
    border-radius: 20px;
    border: 2px solid var(--primary-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
}

.ai-chat-popup.active {
    display: flex;
}

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

/* Chat Header */
.ai-chat-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-color) 100%);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 2px solid var(--primary-color);
}

.ai-chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--primary-light);
    flex-shrink: 0;
}

.ai-chat-avatar video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.ai-chat-info {
    flex: 1;
}

.ai-chat-info h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--darker-bg);
    font-weight: 700;
}

.ai-chat-info p {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.7);
}

.ai-chat-close {
    background: none;
    border: none;
    color: var(--darker-bg);
    font-size: 1.8rem;
    cursor: pointer;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.ai-chat-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

/* Chat Character Display */
.ai-chat-character {
    width: 100%;
    height: 380px;
    position: relative;
    background: linear-gradient(180deg, rgba(11, 14, 17, 0.5) 0%, var(--card-bg) 100%);
    overflow: hidden;
}

.ai-chat-character video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    /* Crop to portrait to show character only */
    transform: scale(1.4);
}

/* Chat Messages Area */
.ai-chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--dark-bg);
}

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

.ai-chat-messages::-webkit-scrollbar-track {
    background: var(--card-bg);
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

/* Message Bubbles */
.message {
    display: flex;
    gap: 0.8rem;
    animation: messageSlide 0.3s ease-out;
}

@keyframes messageSlide {
    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%;
    background: var(--gradient-1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--darker-bg);
    flex-shrink: 0;
}

.message.assistant .message-avatar {
    background: var(--gradient-2);
    font-size: 1.2rem;
}

.message-content {
    max-width: 75%;
    padding: 1rem 1.2rem;
    border-radius: 15px;
    line-height: 1.6;
}

.message.assistant .message-content {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.message.user .message-content {
    background: var(--gradient-1);
    color: var(--darker-bg);
    font-weight: 500;
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
    opacity: 0.7;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 0;
}

.typing-indicator.active {
    display: flex;
}

.typing-dots {
    display: flex;
    gap: 0.3rem;
    padding: 0.8rem 1.2rem;
    background: var(--card-bg);
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: typingBounce 1.4s ease-in-out 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(-8px);
    }
}

/* Chat Input Area */
.ai-chat-input {
    padding: 1.2rem;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.8rem;
}

.ai-chat-input input {
    flex: 1;
    padding: 0.9rem 1.2rem;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.ai-chat-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(240, 185, 11, 0.1);
}

.ai-chat-input input::placeholder {
    color: var(--text-secondary);
}

.ai-chat-send {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--gradient-1);
    border: none;
    color: var(--darker-bg);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ai-chat-send:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(240, 185, 11, 0.5);
}

.ai-chat-send:active {
    transform: scale(0.95);
}

/* Quick Actions */
.ai-quick-actions {
    padding: 0 1.5rem 1rem;
    background: var(--dark-bg);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quick-action-btn {
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-action-btn:hover {
    background: var(--primary-color);
    color: var(--darker-bg);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
}

.welcome-message h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .ai-chat-popup {
        bottom: 110px;
        right: 15px;
        left: 15px;
        width: auto;
        height: 650px;
    }
    
    .ai-chat-button {
        bottom: 20px;
        right: 20px;
        width: 75px;
        height: 75px;
    }
    
    .ai-chat-character {
        height: 250px;
    }
}
