/* === KLAIRE Demo - Clean 3-Column Layout === */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

/* --- Design Tokens --- */
:root {
    --bg-body: #0a0e12;
    --bg-card: #1a1e26;
    --bg-header: #12161c;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --border-color: rgba(255, 255, 255, 0.08);
    --gradient-primary: linear-gradient(135deg, #00f0ff 0%, #ff006e 50%, #ffeb3b 100%);
    --accent-blue: #00f0ff;
    --accent-pink: #ff006e;
    --accent-green: #39ff14;
    --radius: 12px;
    --gap: 24px;
}

/* --- Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* --- Base --- */
body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
}

/* --- App Shell --- */
.app-container {
    display: grid;
    grid-template-rows: auto 1fr;
    height: 100vh;
}

/* --- Header --- */
.header {
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    padding: 12px var(--gap);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
}

.header .logo h1 {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.header .logo .subtitle {
    font-weight: 400;
    color: var(--text-secondary);
}

/* --- Main Grid: 3 Columns --- */
.main-grid {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: var(--gap);
    padding: var(--gap);
    padding-bottom: 64px; /* Footer space */
    min-height: 0;
}

/* --- Glass Panel (shared) --- */
.glass-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.panel-header h2 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

/* --- Left Column: Agent Map --- */
#agent-map {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.agent-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.15s ease;
}

.agent-card:hover {
    background: rgba(255, 255, 255, 0.04);
}

.agent-card.active {
    background: rgba(0, 240, 255, 0.08);
    border-color: rgba(0, 240, 255, 0.3);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #374151;
    flex-shrink: 0;
}

.agent-card.active .status-dot {
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

.agent-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.agent-info {
    flex: 1;
    min-width: 0;
}

.agent-name {
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* --- Center Column: Feed --- */
.feed-section {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.feed-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 80%;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.6;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
}

.message .sender {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.message.buyer {
    align-self: flex-start;
    border-left: 3px solid var(--accent-blue);
}

.message.buyer .sender {
    color: var(--accent-blue);
}

.message.seller {
    align-self: flex-end;
    border-right: 3px solid var(--accent-pink);
}

.message.seller .sender {
    color: var(--accent-pink);
}

.system-message {
    align-self: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 16px;
    border-radius: 20px;
}

/* --- Right Column: Metrics & Controls --- */
.sidebar-right {
    display: flex;
    flex-direction: column;
}

.metrics-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.metric-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
}

.accent-green { color: var(--accent-green); }
.accent-blue { color: var(--accent-blue); }

.control-section {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

#start-btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #000;
    background: var(--gradient-primary);
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#start-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

#start-btn:active {
    transform: translateY(0);
}

/* --- Footer --- */
.app-footer {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 20px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-secondary);
    backdrop-filter: blur(8px);
    z-index: 100;
}

.app-footer a {
    color: var(--accent-blue);
    text-decoration: none;
}

.app-footer a:hover {
    text-decoration: underline;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}
