/* Add custom font definition */
@font-face {
    font-family: 'DingTalkJinBuTi';
    src: url('/static/fonts/DingTalkJinBuTi-Regular.woff2') format('woff2'),
         url('/static/fonts/DingTalkJinBuTi-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    background-color: white;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-width: 800px;
    background-color: white;
    /* Removed box-shadow to make it frameless */
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* Message bubbles use DingTalkJinBuTi */
.message {
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 80%;
    word-wrap: break-word;
    font-family: 'DingTalkJinBuTi', Arial, sans-serif;
}

.user-message {
    background-color: #f1f1f1; /* Changed to light grey */
    margin-left: auto;
}

.ai-message {
    background-color: #e3f2fd; /* Changed to light blue */
    margin-right: auto;
}

.welcome-message {
    font-size: 1.2em; /* Larger welcome message */
    margin: auto; /* Center both vertically and horizontally */
    text-align: center; /* Center the text inside */
    max-width: 90%; /* Allow welcome message to be wider */
}

.input-area {
    padding: 15px;
    background-color: white; /* Removed border/line by not adding border-top */
}

.input-group {
    display: flex;
    gap: 10px;
    align-items: flex-end; /* Align items to the bottom */
}

.form-control {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 18px;
    resize: none;
    font-family: Arial, sans-serif;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
    
    /* Fixed initial height */
    height: 20px;
    min-height: 20px;
    max-height: calc(20px * 3 + 20px); /* 3 lines + padding */
    line-height: 20px;
    
    /* More concentrated gradient effect */
    background: linear-gradient(90deg, 
        white 0%, 
        white 40%, 
        #cce5ff 45%, 
        #cce5ff 55%, 
        white 60%, 
        white 100%);
    background-size: 200% 100%;
    
    /* Animation */
    animation: gradient-move 2s ease-in-out infinite;
}

@keyframes gradient-move {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 100% 0;
    }
}

/* Hide scrollbar when content doesn't overflow */
.form-control:not(:focus) {
    overflow-y: hidden;
}

/* Custom scrollbar for Webkit browsers (Chrome, Safari, etc.) */
.form-control::-webkit-scrollbar {
    width: 6px;
}

.form-control::-webkit-scrollbar-track {
    background: transparent;
}

.form-control::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 10px;
}

.form-control::-webkit-scrollbar-thumb:hover {
    background-color: #aaa;
}

/* Stop animation on focus */
.form-control:focus {
    animation: none;
    background: white;
    outline: none;
}

/* For the placeholder text specifically */
.form-control::placeholder {
    font-family: Arial, sans-serif;
}

.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    font-family: Arial, sans-serif;
}

.btn-primary {
    background-color: #007bff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
}

.btn-primary svg {
    width: 20px;
    height: 20px;
}

/* Styling for the "Hello" part of welcome message */
.highlight-text {
    /* font-weight: bold; */
    font-size: 1.3em;
    color: #0047AB; /* Deep blue color */
}

/* Make sure the typing cursor blinks */
@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

#typing-text::after {
    content: '|';
    animation: blink 1s infinite;
}

.thinking {
    display: flex;
    align-items: center;
    padding: 10px 15px;
}

.thinking-dots {
    display: inline-block;
}

.thinking-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #cce5ff;
    margin-right: 4px;
    animation: thinking 1.4s infinite ease-in-out both;
}

.thinking-dots span:nth-child(1) {
    animation-delay: 0s;
}

.thinking-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.thinking-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes thinking {
    0%, 80%, 100% { 
        transform: scale(0.6);
        opacity: 0.6;
    }
    40% { 
        transform: scale(1);
        opacity: 1;
    }
}