/* assets/css/chatbot.css */

#chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: 'Gluten', cursive;
}

#chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--brand-indigo);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#chatbot-toggle:hover {
    transform: scale(1.1) rotate(5deg);
}

#chatbot-toggle svg {
    width: 30px;
    height: 30px;
}

#chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    max-height: calc(100vh - 120px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.dark #chatbot-window {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

#chatbot-header {
    padding: 15px 20px;
    background: var(--brand-indigo);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#chatbot-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

#chatbot-close {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
}

#chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    animation: messageIn 0.3s ease-out;
}

@keyframes messageIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-ai {
    align-self: flex-start;
    background: #f1f5f9;
    color: #1e293b;
    border-bottom-left-radius: 2px;
}

.dark .message-ai {
    background: #334155;
    color: #f8fafc;
}

.message-user {
    align-self: flex-end;
    background: var(--brand-indigo);
    color: white;
    border-bottom-right-radius: 2px;
}

#chatbot-input-container {
    padding: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 10px;
}

.dark #chatbot-input-container {
    border-top-color: rgba(255, 255, 255, 0.1);
}

#chatbot-input {
    flex: 1;
    padding: 10px 15px;
    border-radius: 25px;
    border: 1px solid #e2e8f0;
    outline: none;
    font-size: 0.9rem;
    transition: border-color 0.2s;
    background: white;
    color: #1e293b;
}

.dark #chatbot-input {
    background: #475569;
    border-color: #64748b;
    color: white;
}

#chatbot-input:focus {
    border-color: var(--brand-indigo);
}

#chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--brand-indigo);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Quiz Style Message */
.quiz-msg {
    border: 2px solid var(--brand-indigo);
    background: white !important;
    color: #1e293b !important;
}

.dark .quiz-msg {
    background: #1e293b !important;
    color: #f8fafc !important;
}

.quiz-question {
    font-weight: 700;
    margin-bottom: 10px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.quiz-option {
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.dark .quiz-option {
    background: #334155;
    border-color: #475569;
}

.quiz-option:hover {
    background: #eef2ff;
    border-color: var(--brand-indigo);
}

.quiz-explanation {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #cbd5e1;
    font-size: 0.85rem;
    font-style: italic;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 5px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #cbd5e1;
    border-radius: 50%;
    animation: typing 1s infinite alternate;
}

.typing-dot:nth-child(2) { animation-delay: 0.3s; }
.typing-dot:nth-child(3) { animation-delay: 0.6s; }

@keyframes typing {
    from { opacity: 0.3; transform: translateY(0); }
    to { opacity: 1; transform: translateY(-4px); }
}

@media (max-width: 480px) {
    #chatbot-window {
        width: calc(100vw - 40px);
        right: 0;
    }
}
