/* Importing Google Fonts - Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,100..900&display=swap');

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

body {
    min-height: 100vh;
    background: #111;
}

.chat-header {
    background: #2e2e2e;
    padding: 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #ff0000;
}

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

.header-info .chatbot-logo {
    height: 35px;
    width: 35px;
    padding: 6px;
    fill: #eaeaea;
    flex-shrink: 0;
    background: #676767;
    border-radius: 50%;
}

.chat-header #close-chatbot {
    border: none;
    color: #1a1a1a;
    height: 40px;
    width: 40px;
    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: #3d39ac;
}

.chat-body {
    padding: 25px 22px;
    display: flex;
    gap: 20px;
    flex: 1;
    overflow-y: auto;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: #ccccf5 transparent;
}

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

.chat-body .bot-message .bot-avatar {
    height: 35px;
    width: 35px;
    padding: 6px;
    fill: #1a1a1a;
    flex-shrink: 0;
    margin-bottom: 2px;
    align-self: flex-end;
    background: #5350C4;
    border-radius: 50%;
}
/*  */
.chat-body .user-message {
    flex-direction: column;
    align-items: flex-end;
}

.chat-body .message .message-text {
    padding: 12px 16px;
    max-width: 60%;
    font-size: 0.95rem;
    background: #2a2a2a;
    border-radius: 12px;
    color: #1a1a1a;
    word-wrap: break-word;
}

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

}

.chat-body .bot-message .message-text {
    background: #e93a3aed;
    border-radius: 13px 13px 13px 3px;
}

.chat-body .user-message .message-text {
    background: #974dff;
    color: #1a1a1a;
    border-radius: 13px 13px 3px 13px;
    align-self: flex-end;
}

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

.chat-body .bot-message .thinking-indicator {
    display: flex;
    gap: 4px;
    padding-block: 15px;
}

.chat-body .bot-message .thinking-indicator .dot {
    height: 7px;
    width: 7px;
    border-radius: 50%;
    background: #6f6bc2;
    animation: dotPulse 1.8s ease-in-out infinite;
}

.chat-body .bot-message .thinking-indicator .dot:nth-child(1) {
    animation-delay: 0.2s;
}

.chat-body .bot-message .thinking-indicator .dot:nth-child(2) {
    animation-delay: 0.3s;
}

.chat-body .bot-message .thinking-indicator .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {
    0%, 44% {
        transform: translateY(0)
    }
    
    28% {
        opacity: 0.4;
        transform: translateY(-4px)
    }
    
    44% {
        opacity: 0.4;
    }
}

.chat-footer {
    position: relative;
    bottom: 0;
    width: 100%;
    background: #1a1a1a;
    padding: 15px 22px 20px;
    border-top: 1px solid #ff0000;
}

.chat-footer .chat-form {
    display: flex;
    align-items: center;
    border-radius: 10px;
    border: 1px solid #444;
    background: #1a1a1a;
    padding: 5px 10px;
    gap: 10px;
}

.chat-footer .chat-form:focus-within {
    outline: 2px solid #5350C4;
}

.chat-form .message-input {
    border: none;
    outline: none;
    height: 47px;
    width: 100%;
    resize: none;
    max-height: 180px;
    font-size: 0.95rem;
    padding: 14px 0 13px 18px;
    border-radius: inherit;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.chat-form .message-input:hover {
    scrollbar-color: #ccccf5 transparent;
}

.chat-form .chat-controls {
    display: flex;
    height: 47px;
    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: #706DB0;
    background: none;
    border-radius: 50%;
    transition: 0.2s ease;
}

.chat-form .chat-controls #send-message {
    color: #1a1a1a;
    display: none;
    background: #5350C4;
}

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

.chat-form .chat-controls #send-message:hover {
    background: #3d39ac;
}

.chat-form .chat-controls button:hover {
    background: #f1f1ff;
}

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

.chat-form .file-upload-wrapper :where(img, button) {
    position: absolute;
}

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

.chat-form .file-upload-wrapper #file-cancel {
    color: #ff0000;
    background: #1a1a1a;
}

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

.chat-form .file-upload-wrapper.file-uploaded img,
.chat-form .file-upload-wrapper.file-uploaded:hover #file-cancel {
    display: block;
}

em-emoji-picker {
    position: absolute;
    left: 50%;
    top: -337px;
    width: 100%;
    max-width: 350px;
    max-height: 330px;
    visibility: hidden;
    transform: translateX(-50%);
}

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

/* Responsive media query for mobile screens */
@media (max-width: 520px) {
    .chat-body {
        height: calc(100% - 140px);
        padding: 25px 15px;
    }

    .chat-footer {
        padding: 10px 15px 15px;
    }

    .chat-form .file-upload-wrapper.file-uploaded #file-cancel {
        opacity: 0;
    }
}

/* Centered chatbot layout for full page */
.chatbot-page {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 0px; /* space below navbar */
}

.chatbot-container {
    display: flex;
    flex-direction: column;
    height: 75vh;
    width: 150vh;
    background: #1a1a1a;
    border-radius: 16px;
    box-shadow: 0 0 20px rgba(255, 140, 0, 0.2);
    border: 1px solid #333;
    overflow: hidden;
}

.logo-text {
    color: #fd4343;
    font-size: 1.5rem;
    margin-left: 12px;
}

.chat-body {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #121212;
    color: #1a1a1a;
}

.bot-message {
    background: #2a2a2a;
    border-left: 4px solid #ff0000;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
}

.message-text {
    color: #eee;
    line-height: 1.6;
}

.chat-footer {
    background: #2e2e2e;
    padding: 15px;
    border-top: 1px solid #ff0400;
}

.message-input {
    width: 100%;
    border: 1px solid #555;
    background: #1a1a1a;
    color: white;
    border-radius: 10px;
    padding: 10px 15px;
    font-size: 1rem;
    resize: none;
}

.chat-controls button,
.chat-controls .material-symbols-outlined,
.chat-controls .material-symbols-rounded {
    background: #ff4d4d;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.2s ease;
}

.chat-controls button:hover {
    background: #ff1a1a;
}