/* Global Styles */
:root {
    --primary-color: #6366f1; /* Indigo */
    --primary-hover: #4f46e5;
    --bg-color: #f8fafc; /* Slate 50 */
    --sidebar-bg: #ffffff;
    --text-main: #1e293b; /* Slate 800 */
    --text-muted: #64748b; /* Slate 500 */
    --border-color: #e2e8f0; /* Slate 200 */
    --chat-bg-user: #eff6ff; /* Blue 50 */
    --chat-bg-assistant: #ffffff;
    --log-bg: #1e1e1e; /* Dark for logs */
    --log-text: #00ff00; /* Terminal green */
    --shadow-soft:
        0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius: 12px;
}

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

body {
    font-family:
        "Outfit",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    overflow: hidden;
}

/* App Container Layout */
.app-container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Sidebar Styling */
.sidebar {
    width: 350px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    overflow-y: auto;
}

.sidebar-header {
    margin-bottom: 2rem;
}

.sidebar-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-main);
}

.sidebar-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Configuration Section */
.config-section {
    margin-bottom: 2rem;
}

.config-section h2,
.education-panel h2 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 600;
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    font-weight: 500;
}

.input-group .required {
    color: #ef4444;
}

.input-group input {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.input-group small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Educational Panel (Logs) */
.education-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.logs-container {
    background-color: var(--log-bg);
    color: var(--log-text);
    padding: 1rem;
    border-radius: 8px;
    font-family: "Consolas", "Monaco", monospace;
    font-size: 0.8rem;
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.log-entry {
    margin-bottom: 0.5rem;
    line-height: 1.4;
    word-break: break-all;
}

.log-entry.info {
    color: #88ff88;
} /* Green */
.log-entry.request {
    color: #88ccff;
} /* Blue */
.log-entry.error {
    color: #ff8888;
} /* Red */
.log-entry .timestamp {
    color: #666;
    margin-right: 0.5rem;
}

/* Main Chat Interface */
.chat-interface {
    flex: 1; /* Take remaining space */
    display: flex;
    flex-direction: column;
    background-color: #fff;
}

.chat-history {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background-color: var(--bg-color);
}

.message {
    display: flex;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.3s ease;
}

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

.message .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-right: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.message .content {
    background-color: #fff;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    max-width: 80%;
    line-height: 1.6;
    border: 1px solid var(--border-color);
}

/* User Message specific */
.message.user {
    flex-direction: row-reverse;
}

.message.user .avatar {
    margin-right: 0;
    margin-left: 1rem;
    background-color: var(--chat-bg-user);
}

.message.user .content {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-soft);
    border: none;
}

/* Chat Input Area */
.chat-input-area {
    padding: 1.5rem 2rem;
    background-color: #fff;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
}

textarea {
    flex: 1;
    height: 50px;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 20px; /* Pill shape */
    resize: none;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    height: 60px; /* Slight expand on focus */
}

button {
    padding: 0 1.5rem;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: var(--primary-hover);
}

button:disabled {
    background-color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.5;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 300px;
    }
    .chat-interface {
        height: 0; /* Let flex-grow handle it */
    }
}
