/* Suresh-specific styling - Red and White theme */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f8f8;
    color: #333;
}

.chat-container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.chat-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: #ffffff; /* White header background */
    border-bottom: 1px solid #e9ecef;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    color: #333333; /* Dark text color */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.logo {
    height: 36px;
    margin-right: 15px;
    /* For SVG and PNG compatibility */
    object-fit: contain;
    max-width: 120px;
}

.chat-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #e53e3e; /* Red color for "Suresh" text */
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background-color: #f9f9f9;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    margin-bottom: 12px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    clear: both;
    line-height: 1.5;
}

.user-message {
    align-self: flex-end;
    background-color: #e53e3e; /* Red background for user messages */
    color: white;
    border-bottom-right-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.assistant-message {
    align-self: flex-start;
    background-color: white;
    color: #333;
    border-bottom-left-radius: 5px;
    border: 1px solid #eaeaea;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.message-text {
    font-size: 14px;
}

/* Markdown styling for Suresh */
.markdown-content h1, 
.markdown-content h2, 
.markdown-content h3 {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
    color: #383838;
}

.markdown-content h1 {
    font-size: 1.5em;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.3em;
}

.markdown-content h2 {
    font-size: 1.3em;
}

.markdown-content h3 {
    font-size: 1.1em;
}

.markdown-content ul, 
.markdown-content ol {
    padding-left: 1.5em;
    margin: 0.5em 0;
}

.markdown-content ul li, 
.markdown-content ol li {
    margin: 0.3em 0;
}

.markdown-content code {
    font-family: 'Courier New', monospace;
    background-color: #f5f5f5;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}

.markdown-content pre {
    background-color: #f5f5f5;
    padding: 1em;
    border-radius: 5px;
    overflow-x: auto;
    margin: 0.5em 0;
}

.markdown-content pre code {
    background-color: transparent;
    padding: 0;
}

.markdown-content a {
    color: #e53e3e; /* Red links */
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

.markdown-content blockquote {
    border-left: 4px solid #e53e3e; /* Red quote border */
    margin-left: 0;
    padding-left: 1em;
    color: #666;
}

.chat-input {
    display: flex;
    padding: 15px;
    border-top: 1px solid #e9ecef;
    background-color: #fff;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.chat-input input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
}

.chat-input input:focus {
    border-color: #e53e3e; /* Red border on focus */
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.chat-input button {
    background-color: #e53e3e; /* Red button */
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0 20px;
    margin-left: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.chat-input button:hover {
    background-color: #c53030; /* Darker red on hover */
}

/* Function call indicator styling */
.function-indicator {
    color: #666;
    font-size: 0.8em;
    font-style: italic;
    padding: 5px 15px;
    margin: 5px 0;
    background-color: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 15px;
    text-align: center;
    animation: pulse 1.5s infinite;
    align-self: center;
    width: 80%;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* Error message styling */
.error-message {
    color: white;
    background-color: #e53e3e; /* Red error message */
    padding: 10px;
    margin: 5px 0;
    border-radius: 4px;
    align-self: center;
    width: 80%;
    text-align: center;
}

/* Typing indicator */
.typing-indicator {
    display: inline-block;
    width: 30px;
    text-align: center;
    margin-left: 10px;
}

.typing-indicator span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #e53e3e; /* Red dots */
    border-radius: 50%;
    margin: 0 1px;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
}

/* Media queries for responsiveness */
@media (max-width: 768px) {
    .chat-container {
        max-width: 100%;
        height: 100vh;
        border-radius: 0;
    }
    
    .message {
        max-width: 85%;
    }
    
    .chat-header {
        border-radius: 0;
    }
}

/* Add a subtle red scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f9f9f9;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: #e53e3e;
    border-radius: 10px;
    border: 2px solid #f9f9f9;
}

/* Make sure the height of the chat container fills the viewport */
html, body {
    height: 100%;
}

/* Table styling for markdown */
.markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
}

.markdown-content th,
.markdown-content td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.markdown-content th {
    background-color: #f8f8f8;
    font-weight: bold;
}

.markdown-content tr:nth-child(even) {
    background-color: #f9f9f9;
}
