@import url('https://fonts.googleapis.com/css2?family=Caveat&family=Inter:wght@100..900&family=Playfair+Display:wght@400;500;600;700&family=Roboto:wght@100..900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Inter", sans-serif;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

#chatbot-toggler {
    position: fixed;
    bottom: 30px;
    right: 35px;
    border: none;
    height: 60px;
    width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 1000;
}

#chatbot-toggler:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

body.show-chatbot #chatbot-toggler {
    transform: rotate(90deg) scale(1.1);
}

#chatbot-toggler span {
    color: #fff;
    position: absolute;
    font-size: 28px;
}

body.show-chatbot #chatbot-toggler span:first-child,
#chatbot-toggler span:last-child {
    opacity: 0;
}

body.show-chatbot #chatbot-toggler span:last-child {
    opacity: 1;
}
.chatbot-popup {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 550px;
    max-width: 95vw;
    height: 800px;
    max-height: 90vh;
    background-color: #fff;
    border-radius: 20px;
    display: block;
    opacity: 1;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    z-index: 999;
    overflow: hidden;
}


body.show-chatbot .chatbot-popup {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%);
}
@media (max-width: 500px) {
    .chatbot-popup {
        width: 95vw;
        height: 95vh;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .chat-body {
        height: calc(95vh - 160px); /* header + footer estimated height */
    }

    .chat-body .message .message-text {
        max-width: 90%;
    }

    .chat-footer {
        padding: 8px;
    }

    .chat-footer .chat-form {
        flex-direction: column;
        gap: 6px;
        border-radius: 20px;
    }

    .chat-form .message-input {
        font-size: 0.9rem;
        padding: 10px 14px;
    }

    .chat-form .chat-controls {
        justify-content: space-between;
        width: 100%;
        padding-right: 0;
    }

    .chat-form .chat-controls button {
        height: 32px;
        width: 32px;
        font-size: 1rem;
    }
}



.chat-header {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 22px;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chat-header .header-info {
    display: flex;
    gap: 10px;
    align-items: center;
}

.header-info .chatbot-logo {
    height: 35px;
    width: 35px;
    padding: 6px;
    fill: #fff;
    flex-shrink: 0;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.header-info .logo-text {
    color: #fff;
    font-size: 1.31rem;
    font-weight: 600;
    font-family: 'Playfair Display', serif;
    letter-spacing: 0.5px;
}

.chat-header #close-chatbot {
    border: none;
    color: #fff;
    height: 35px;
    width: 35px;
    font-size: 1.9rem;
    margin-right: -10px;
    padding-top: 2px;
    cursor: pointer;
    border-radius: 50%;
    background: none;
    transition: 0.2s ease;
}

.chat-header #close-chatbot:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.chat-body {
    padding: 25px 22px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 500px;
    overflow-y: auto;
    margin-bottom: 82px;
    scrollbar-width: thin;
    scrollbar-color: #667eea transparent;
    background-color: #f9f9ff;
}

.chat-body::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-thumb {
    background-color: #667eea;
    border-radius: 3px;
}

.chat-body .message {
    display: flex;
    gap: 11px;
    align-items: flex-start;
}

.chat-body .bot-message .bot-avatar {
    height: 35px;
    width: 35px;
    padding: 6px;
    fill: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    flex-shrink: 0;
}

.chat-body .user-message {
    flex-direction: column;
    align-items: flex-end;
}

.chat-body .message .message-text {
    padding: 12px 16px;
    max-width: 75%;
    font-size: 0.95rem;
    line-height: 1.5;
    border-radius: 13px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.chat-body .bot-message.thinking .message-text {
    padding: 2px 16px;
}

.chat-body .bot-message .message-text {
    background: #fff;
    border: 1px solid #e0e0ff;
    color: #333;
}

.chat-body .user-message .message-text {
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 13px 13px 3px 13px;
}

.chat-body .user-message .attachment {
    width: 50%;
    margin-top: -7px;
    border-radius: 13px 3px 13px 13px;
    border: 1px solid #e0e0ff;
}

.chat-body .bot-message .thinking-indicator {
    display: flex;
    gap: 5px;
    padding-block: 15px;
    align-items: center;
}

.chat-body .bot-message .thinking-indicator .dot {
    height: 8px;
    width: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation: dotPulse 1.5s ease-in-out infinite;
}

@keyframes dotPulse {
    0% {
        opacity: 0.6;
        transform: translateY(0);
    }
    28% {
        opacity: 0.8;
        transform: translateY(-3px);
    }
    44% {
        opacity: 1;
        transform: translateY(-3px);
    }
    100% {
        opacity: 0.6;
        transform: translateY(0);
    }
}

.chat-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 10px;
    background: white;
    border-top: 1px solid #e0e0ff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.chat-footer .chat-form {
    display: flex;
    position: relative;
    align-items: center;
    background: #fff;
    border-radius: 32px;
    outline: 1px solid #e0e0ff;
    transition: all 0.3s ease;
}

.chat-footer .chat-form:focus-within {
    outline: 2px solid #667eea;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.2);
}

.chat-form .message-input {
    border: none;
    outline: none;
    height: 47px;
    width: 100%;
    resize: none;
    max-height: 180px;
    white-space: pre-line;
    font-size: 0.95rem;
    padding: 14px 0 13px 18px;
    border-radius: inherit;
    transition: height 0.2s ease;
    background: transparent;
}

.chat-form .message-input::placeholder {
    color: #aaa;
}

.chat-form .chat-controls {
    display: flex;
    height: 47px;
    gap: 3px;
    align-items: center;
    align-self: flex-end;
    padding-right: 6px;
}

.chat-form .chat-controls button {
    height: 35px;
    width: 35px;
    border: none;
    font-size: 1.15rem;
    cursor: pointer;
    color: #667eea;
    background: #f1f1ff;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.chat-form .chat-controls button:hover {
    background: #e0e0ff;
    transform: scale(1.1);
}

.chat-form .chat-controls #send-message {
    color: #FFF;
    display: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.chat-form .message-input:valid ~ .chat-controls #send-message {
    display: block;
}

.chat-form .chat-controls #send-message:hover {
    background: linear-gradient(135deg, #5a6fd1 0%, #6a4199 100%);
}

.chat-form .file-upload-wrapper {
    height: 35px;
    width: 35px;
    position: relative;
}

.chat-form .file-upload-wrapper img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: none;
}

.chat-form .file-upload-wrapper .file-uploaded img {
    display: block;
}

.chat-form .file-upload-wrapper #file-cancel {
    color: #ff6b6b;
    background: #fff;
    border: 1px solid #ff6b6b;
}

.chat-form .file-upload-wrapper :where(img, #file-cancel),
.chat-form .file-upload-wrapper .file-uploaded #file-upload {
    display: none;
}

em-emoji-picker {
    position: absolute;
    left: 50%;
    top: -337px;
    width: 100%;
    max-width: 350px;
    max-height: 330px;
    visibility: hidden;
    transform: translateX(-50%);
    border: 1px solid #e0e0ff;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    z-index: 1001;
}

body.show-emoji-picker em-emoji-picker {
    visibility: visible;
}

/* Word of the Day Card */
.word-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin: 10px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #667eea;
}

.word-card h3 {
    color: #764ba2;
    margin-bottom: 8px;
    font-family: 'Playfair Display', serif;
}

.word-card .pronunciation {
    color: #666;
    font-style: italic;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.word-card .definition {
    margin-bottom: 10px;
    line-height: 1.5;
}

.word-card .example {
    padding: 8px;
    background: #f5f7ff;
    border-radius: 6px;
    font-size: 0.9em;
    border-left: 2px solid #c3cfe2;
}

.word-card .synonyms {
    margin-top: 10px;
    font-size: 0.85em;
    color: #667eea;
}

/* Responsive adjustments */
@media (max-width: 500px) {
    .chatbot-popup {
        width: 90vw;
        right: 5vw;
    }
    
    .chat-body {
        height: 60vh;
    }
    
    .chat-body .message .message-text {
        max-width: 85%;
    }
}