.chat-main {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    height: calc(100vh - 74px - 100px); /* Adjust based on header and footer height */
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.bot-message {
    align-self: flex-start;
    background-color: var(--surface-color);
    color: var(--text-highlight);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.user-message {
    align-self: flex-end;
    background-color: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-footer {
    background-color: var(--surface-color);
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.2);
    border-top: 2px solid var(--primary-color);
}

.input-container {
    display: flex;
    gap: 10px;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 5px 5px 5px 15px;
    border-radius: 25px;
    border: 2px solid var(--border-color);
    transition: border-color 0.3s;
}

.input-container:focus-within {
    border-color: var(--primary-color);
}

#user-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-highlight);
    padding: 10px 0;
    font-size: 1rem;
    outline: none;
    font-family: var(--font-family);
}

#send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.2s;
}

#send-btn:hover {
    background-color: var(--primary-dark);
}

#send-btn:active {
    transform: scale(0.9);
}

#send-btn:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
}

.copyright {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-color);
    margin-top: 10px;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 5px 0;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: var(--text-color);
    border-radius: 50%;
    animation: typing 1s infinite ease-in-out;
}

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

@keyframes typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@media (max-width: 600px) {
    .chat-main {
        height: calc(100vh - 180px); /* Increased to account for larger footer */
    }
    .chat-footer {
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }
}
