/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Figtree', sans-serif;
    background-color: #f7f7f9;
    color: #333;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Chat Container */
.chat-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Header */
header {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    background-color: white;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3648;
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Message Styles */
.message {
    display: flex;
    margin-bottom: 12px;
    max-width: 80%;
}

.message.user {
    margin-left: auto;
    justify-content: flex-end;
}

.message-content {
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
}

.user .message-content {
    background-color: #333;
    color: white;
    border-radius: 12px 12px 0 12px;
}

.assistant .message-content {
    background-color: #f0f2f5;
    color: #2d3648;
    border-radius: 12px 12px 12px 0;
}

/* Markdown Styling */
.message-content p {
    margin-bottom: 8px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
    margin-top: 16px;
    margin-bottom: 8px;
    font-weight: 600;
    line-height: 1.25;
}

.message-content h1 {
    font-size: 1.5em;
}

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

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

.message-content ul,
.message-content ol {
    margin-bottom: 8px;
    padding-left: 24px;
}

.message-content li {
    margin-bottom: 4px;
}

.message-content blockquote {
    padding-left: 12px;
    border-left: 3px solid #ccc;
    color: #666;
    margin: 8px 0;
}

.message-content pre {
    margin: 8px 0;
    padding: 12px;
    border-radius: 6px;
    background-color: #f6f8fa;
    overflow-x: auto;
}

.message-content code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9em;
    padding: 0.2em 0.4em;
    background-color: rgba(27, 31, 35, 0.05);
    border-radius: 3px;
}

.message-content pre code {
    padding: 0;
    background-color: transparent;
    white-space: pre;
}

.message-content table {
    border-collapse: collapse;
    margin: 8px 0;
    width: 100%;
}

.message-content table th,
.message-content table td {
    padding: 6px 13px;
    border: 1px solid #dfe2e5;
}

.message-content table th {
    background-color: #f6f8fa;
    font-weight: 600;
}

.message-content table tr:nth-child(2n) {
    background-color: #f6f8fa;
}

.message-content img {
    max-width: 100%;
    height: auto;
}

.message-content a {
    color: #555;
    text-decoration: none;
    font-weight: 500;
}

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

.user .message-content a,
.user .message-content code,
.user .message-content pre {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.2);
}

.user .message-content a {
    color: #fff;
    text-decoration: underline;
}

.user .message-content pre {
    background-color: rgba(0, 0, 0, 0.5);
}

.user .message-content pre code {
    background-color: transparent;
}

/* Status Indicator */
.status-indicator {
    padding: 0 20px;
    height: 20px;
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

/* Input Area */
.chat-input-container {
    padding: 16px 20px;
    border-top: 1px solid #f0f0f0;
    background-color: white;
}

#chat-form {
    display: flex;
    gap: 10px;
}

#user-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    font-family: 'Figtree', sans-serif;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

#user-input:focus {
    border-color: #555;
}

button {
    background-color: #333;
    color: white;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #555;
}

button svg {
    width: 20px;
    height: 20px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
    background-color: #f0f2f5;
    border-radius: 12px 12px 12px 0;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: #999;
    border-radius: 50%;
    animation: typing-animation 1.4s infinite both;
}

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

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

/* Tool Search Icon */
.tool-search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 0;
}

.tool-search-icon svg {
    width: 20px;
    height: 20px;
    stroke: #555;
}

.spinning-icon {
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes typing-animation {
    0%, 100% {
        opacity: 0.5;
        transform: scale(0.75);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .chat-container {
        border-radius: 0;
        height: 100vh;
    }
    
    .message {
        max-width: 90%;
    }
} 