/* Chat Interface */
#chat-container {
    background: var(--color-surface-dark);
    border-radius: var(--border-radius-md);
    display: flex;
    flex-direction: column;
    height: 75vh;
    min-height: 500px;
    max-width: 800px;
    margin: var(--space-lg) auto;
    box-shadow: var(--shadow-lg);
    border: var(--border-width) solid var(--color-border);
}

#chat-header {
    background: var(--color-surface);
    color: var(--color-text-on-accent);
    padding: var(--space-sm) var(--space-md);
    border-bottom: var(--border-width) solid var(--color-border);
    border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#chat-header h3 {
    font-size: 1.2rem;
}

#restart-button {
    background: var(--color-accent);
    color: var(--color-text-on-accent);
    border: none;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: background 0.3s ease;
}

#restart-button:hover {
    background: #677bc4; /* Darker accent */
}

#chat-history {
    position: relative;
    flex-grow: 1;
    overflow-y: auto;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.chat-message {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--border-radius-md);
    max-width: 75%;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    animation: message-fade-in 0.3s ease-out;
}

.bot-message {
    background: var(--color-surface);
    color: var(--color-text-primary);
    align-self: flex-start;
}

.user-message {
    background: var(--color-accent);
    color: var(--color-text-on-accent);
    align-self: flex-end;
}

.message-header {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xs);
    font-weight: bold;
}

.user-message .message-header {
    color: #ddd;
}

.message-body {
    white-space: pre-wrap;
}

#question-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-top: var(--border-width) solid var(--color-border);
}

#question-buttons button {
    background: var(--color-surface-light);
    color: var(--color-text-on-accent);
    border: var(--border-width) solid #555;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: var(--transition-base);
}

#question-buttons button:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

#chat-input-fake {
    display: flex;
    padding: var(--space-md);
    border-top: var(--border-width) solid var(--color-border);
    background: var(--color-surface);
    border-radius: 0 0 var(--border-radius-md) var(--border-radius-md);
    gap: var(--space-sm); /* Add gap for spacing */
}

#chat-input-fake input {
    flex-grow: 1;
    flex-shrink: 1; /* Allow shrinking */
    min-width: 0;   /* Allow content to shrink to 0 if needed */
    background: var(--color-surface-light);
    border: var(--border-width) solid #555;
    color: var(--color-text-on-accent);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-lg);
}

#chat-input-fake button {
    background: var(--color-accent);
    color: var(--color-text-on-accent);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-lg);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Thinking Animation */
.thinking .dot-flashing {
    position: relative;
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background-color: var(--color-text-secondary);
    color: var(--color-text-secondary);
    animation: dot-flashing 1s infinite linear alternate;
    animation-delay: .5s;
}

.thinking .dot-flashing::before,
.thinking .dot-flashing::after {
    content: '';
    display: inline-block;
    position: absolute;
    top: 0;
}

.thinking .dot-flashing::before {
    left: -15px;
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background-color: var(--color-text-secondary);
    animation: dot-flashing 1s infinite alternate;
    animation-delay: 0s;
}

.thinking .dot-flashing::after {
    left: 15px;
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background-color: var(--color-text-secondary);
    animation: dot-flashing 1s infinite alternate;
    animation-delay: 1s;
}
