/* css/chatbot.css */

.chatbot-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translateX(-50%) translateY(-30%) scale(0.95);
    width: 90%;
    max-width: 400px;
    height: 60vh;
    max-height: 600px;
    background: linear-gradient(to bottom, #1e3a5f 0%, #0f0f14 25%, #0f0f14 100%); /* Dark with light blue gradient at top */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    animation: rainbowGlowWindow 4s infinite;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes rainbowGlowWindow {
    0% { box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255,0,127,0.5), 0 0 25px rgba(127,0,255,0.3); }
    33% { box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0,127,255,0.5), 0 0 25px rgba(0,255,127,0.3); }
    66% { box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255,127,0,0.5), 0 0 25px rgba(255,0,127,0.3); }
    100% { box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255,0,127,0.5), 0 0 25px rgba(127,0,255,0.3); }
}

.chatbot-overlay.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(-50%) scale(1);
}

.chatbot-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 24px 24px 0 0;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
}

.chatbot-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.chatbot-close:hover {
    color: white;
}

.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Custom scrollbar for messages */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}
.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}

.chat-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
    animation: popIn 0.3s ease-out forwards;
}

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

.chat-msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #9333ea, #3b82f6);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-msg.siri {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border-bottom-left-radius: 4px;
}

.chat-msg.siri::before {
    content: 'Lexi';
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 5px;
    font-weight: 500;
}

.chat-msg.siri p {
    margin: 0 0 10px 0;
}
.chat-msg.siri p:last-child {
    margin: 0;
}

/* Game recommendation button */
.chat-play-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    background: linear-gradient(45deg, #ff007f, #007fff);
    color: white;
    text-decoration: none;
    font-weight: 700;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.2s, filter 0.2s;
    border: none;
    cursor: pointer;
}
.chat-play-btn:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.chatbot-input-area {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 0 24px 24px;
}

.chatbot-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 10px 15px;
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input-area input:focus {
    border-color: #3b82f6;
}

.chatbot-input-area button {
    background: linear-gradient(45deg, #3b82f6, #9333ea);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
}

.chatbot-input-area button:hover {
    transform: scale(1.1);
}
.chatbot-input-area button:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255,255,255,0.3);
    cursor: not-allowed;
    transform: none;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    width: fit-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

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

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}
