﻿body {
    background-color: #0f172a; /* dark navy */
    color: #e2e8f0; /* light text */
    font-family: Arial, sans-serif;
}

textarea, input {
    background-color: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
    padding: 10px;
    width: 100%;
}

button {
    background-color: #2563eb;
    color: white;
    border: none;
    padding: 10px 15px;
    margin-top: 5px;
    cursor: pointer;
}

button:hover {
    background-color: #1d4ed8;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 20px;
    margin-top: 30px;
}

/* Agent-box Styling - darktheme*/
.agent {
    background: #222;
    padding: 15px;
    border-radius: 8px;
}

/* Final-box Styling - darktheme*/
.final {
    grid-column: span 3;
    background: #333;
}

#followup_input {
    width: 80%;
    height: 80px;
    padding: 10px;
    font-size: 14px;
    resize: vertical;
    margin-top: 10px;
}

#initial_input {
    width: 100%;
    height: 100px;
    padding: 10px;
    font-size: 14px;
}


/* Chat styling */
.user-msg {
    background-color: #1e40af;
    padding: 10px;
    margin: 10px 0;
    border-radius: 6px;
}

.ai-msg {
    background-color: #334155;
    padding: 10px;
    margin: 10px 0;
    border-radius: 6px;
}

/* Label styles */
.label-client {
    color: #93c5fd;
    font-weight: bold;
}

.label-agent {
    color: #fca5a5;
    font-weight: bold;
}


.choice-container {
    margin-top: 15px;
    margin-bottom: 20px;
}

.choice-btn {
    margin-right: 10px;
    padding: 8px 14px;
    background-color: #2f5eff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.choice-btn:hover {
    background-color: #1e3fcc;
}


/* Input box */
#main_input {
    font-size: 16px;
    padding: 10px;
    margin-bottom: 10px;
}

/* Buttons */
button {
    padding: 8px 14px;
    margin-right: 10px;
    cursor: pointer;
}

/* Chat messages spacing */
.user-msg, .ai-msg {
    margin-bottom: 15px;
}

/* Agent grid spacing */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}


/* Layout Splits */
.main-container {
    display: flex;
    gap: 20px;
    height: 80vh; /* Keeps the UI contained in view */
    margin: 20px;
}

.left-panel {
    flex: 0 0 45%;
    display: flex;
    flex-direction: column;
}

.right-panel {
    flex: 0 0 55%;
    border-left: 2px solid #555;
    padding-left: 20px;
}

/* Chat display fixes */
.chat-display {
    height: 400px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
    background: #0d1117;
}

/* Broad-Board Grid */
.broad-board-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 🔹 Fixed 2-column layout */
    gap: 15px;
    height: 90%;
    overflow-y: auto;
}

/* Individual Agent Boxes */
.agent-box {
    border: 1px solid #7a4f2b;
    border-radius: 10px;
    background: #161b22;
    padding: 10px;
    height: 180px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    min-width: 0; /* 🔹 CRITICAL: Allows flex items to shrink below content size */
    overflow: hidden; /* 🔹 Keeps everything contained */
}

.agent-box h3 {
    margin: 0 0 10px 0;
    font-size: 1rem;
    color: #4CAF50;
    text-align: center;
}

/* 🔹 THE CRITICAL FIX: Scrollbar per agent */
.agent-content {
    flex-grow: 1;
    overflow-y: auto; /* Internal scrollbar */
    filter: blur(10px); /* Passive state */
    transition: filter 0.3s ease;
    font-size: 0.85rem;
    background: #0d1117;
    padding: 5px;
}

/* Force text wrapping inside the <pre> tag */
.agent-content pre {
    white-space: pre-wrap; /* 🔹 CSS3 - preserves spaces but wraps */
    word-wrap: break-word; /* 🔹 Ensures long words don't break the UI */
    margin: 0;
    font-family: inherit;
    font-size: 0.85rem;
    white-space: pre-wrap; /* */
    word-wrap: break-word; /* */
    line-height: 1.4;
}

.agent-content.revealed {
    filter: blur(0);
}

/* Scrollbar Styling */
.agent-content::-webkit-scrollbar {
    width: 6px;
}

.agent-content::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

/* Styling for the /board headers inside agent boxes */
.insight-header {
    color: #fca5a5; /* Light red for distinction */
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.75rem;
    margin-top: 10px;
    display: block;
    border-bottom: 1px solid #334155;
}

/* Styling for the 4 specific Epistemic headers */
.insight-section-header {
    display: block;
    background: #1e293b; /* Subtle contrast background */
    color: #60a5fa; /* Epistemic Blue */
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 5px;
    margin-top: 8px;
    border-radius: 3px;
    text-transform: uppercase;
    border-left: 2px solid #3b82f6;
}


/* Premium Polish */
#chat {
    background-color: #020617;
    border-radius: 8px;
}

textarea:focus {
    outline: none;
    border: 1px solid #3b82f6;
}


.system-msg {
    background: #1f2937;
    border-left: 4px solid #3b82f6;
    padding: 12px;
    margin-top: 10px;
    color: #d1d5db;
}

.top-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}