/* Mission Control - Agent Floor Dashboard */
:root {
    --bg-dark: #0a0e17;
    --panel: #111625;
    --panel-hover: #1a1f2e;
    --accent: #00d4ff;
    --text: #e0e0e0;
    --text-muted: #666;
    --success: #00ff88;
    --warning: #ffaa00;
    --danger: #ff4444;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    background: var(--bg-dark);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Login */
#login-screen {
    position: fixed; inset: 0; background: var(--bg-dark);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}
.login-box {
    background: var(--panel); border: 2px solid var(--accent);
    border-radius: 12px; padding: 2rem; width: 320px; text-align: center;
}
.login-box h1 { color: var(--accent); margin-bottom: 0.5rem; }
.login-box input {
    width: 100%; padding: 0.8rem; margin: 1rem 0;
    background: var(--bg-dark); border: 1px solid #333;
    color: white; border-radius: 6px;
}
.login-box button {
    background: var(--accent); color: var(--bg-dark);
    border: none; padding: 0.8rem 2rem; border-radius: 6px;
    font-weight: bold; cursor: pointer; width: 100%;
}
.error { color: var(--danger); margin-top: 1rem; display: none; }

/* Dashboard */
#dashboard { display: none; }
#dashboard.active { display: block; }

.header {
    background: var(--panel); border-bottom: 1px solid var(--accent);
    padding: 1rem 2rem; display: flex; justify-content: space-between; align-items: center;
}
.logo { display: flex; align-items: center; gap: 1rem; }
.logo .icon { font-size: 2rem; }
.logo h1 { font-size: 1.5rem; }
.meta { display: flex; gap: 2rem; font-size: 0.9rem; color: var(--text-muted); }

/* Main */
.main { padding: 1.5rem; }

/* Summary Grid */
.summary-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem; margin-bottom: 2rem;
}
.summary-card {
    background: var(--panel); border-radius: 8px; padding: 1rem;
    text-align: center; border-left: 3px solid var(--accent);
}
.summary-card .label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.summary-card .value { font-size: 1.5rem; font-weight: bold; }

/* Agent Grid */
.agent-floor {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}
@media (max-width: 1024px) { .agent-floor { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .agent-floor { grid-template-columns: 1fr; } }

/* Agent Card */
.agent-card {
    background: var(--panel); border-radius: 12px; padding: 1.5rem;
    position: relative; overflow: hidden; transition: transform 0.3s, border-color 0.3s;
}
.agent-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.agent-status {
    position: absolute; top: 1rem; right: 1rem; width: 12px; height: 12px;
    border-radius: 50%; animation: pulse 2s infinite;
}
.agent-status.working { background: var(--success); }
.agent-status.idle { background: var(--text-muted); }
.agent-status.blocked { background: var(--danger); }
.agent-status.sleeping { background: var(--warning); }

.agent-header {
    display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem;
}
.agent-icon { font-size: 2.5rem; }
.agent-info h3 { font-size: 1.2rem; margin-bottom: 0.25rem; }
.agent-info .role { font-size: 0.9rem; color: var(--text-muted); }
.agent-specialty { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1rem; }

/* CSS Robot */
.robot {
    width: 120px; height: 120px; margin: 1rem auto;
    position: relative;
}
.robot-head, .robot-body, .robot-arm {
    background: var(--accent);
}
.robot-head {
    width: 50px; height: 40px; border-radius: 8px;
    margin: 0 auto; position: relative;
}
.robot-body {
    width: 40px; height: 50px;
    margin: 0 auto; border-radius: 6px; position: relative;
}
.robot-arms {
    position: absolute; width: 100%; height: 20px; top: 50px;
}
.robot-arm {
    width: 12px; height: 30px;
    position: absolute; border-radius: 6px;
}
.robot-arm.left { left: 10px; transform-origin: top; }
.robot-arm.right { right: 10px; transform-origin: top; }
.robot-eyes {
    position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 8px;
}
.robot-eye {
    width: 8px; height: 8px; background: var(--bg-dark); border-radius: 50%;
}

/* Animations */
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes arms-moving { 0%,100% { transform: rotate(-20deg); } 50% { transform: rotate(20deg); } }
@keyframes breathing { 0%,100% { transform: scale(1); } 50% { transform: scale(1.02); } }
@keyframes coffee-sip { 0%,100% { transform: rotate(0deg); } 25% { transform: rotate(-30deg); } 75% { transform: rotate(30deg); } }
@keyframes zzz-float { 0% { transform: translateY(0) scale(0.8); opacity: 0; } 50% { opacity: 1; } 100% { transform: translateY(-20px) scale(1.2); opacity: 0; } }
@keyframes question-blink { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.working .robot-arm.left { animation: arms-moving 1s infinite ease-in-out; }
.working .robot-arm.right { animation: arms-moving 1s infinite ease-in-out reverse; }
.idle .robot-body { animation: breathing 2s infinite; }
.break .robot-arm.right { animation: coffee-sip 2s infinite; }
.sleeping .zzz { display: block; position: absolute; top: -10px; right: 0; animation: zzz-float 1.5s infinite; }
.blocked .robot-eyes { animation: question-blink 1s infinite; }

.zzz { display: none; font-size: 1.2rem; color: var(--accent); }

/* Stats */
.agent-stats {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 1rem;
}
.stat {
    background: var(--bg-dark); padding: 0.5rem; border-radius: 4px; text-align: center;
}
.stat-label { font-size: 0.7rem; color: var(--text-muted); }
.stat-value { font-size: 1rem; font-weight: bold; }

.agent-task {
    margin-top: 1rem; padding: 0.75rem; background: var(--bg-dark);
    border-radius: 6px; font-size: 0.85rem;
}
.agent-task strong { color: var(--accent); display: block; margin-bottom: 0.25rem; }

/* Tabs */
.tabs {
    display: flex; background: var(--panel); border-radius: 8px; padding: 0.5rem; margin-bottom: 1.5rem;
    overflow-x: auto;
}
.tab {
    flex: 1; min-width: 100px; background: none; border: none;
    color: var(--text-muted); padding: 0.75rem; cursor: pointer;
    border-radius: 6px; transition: all 0.2s; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--accent); color: var(--bg-dark); font-weight: bold; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Panels */
.panel {
    background: var(--panel); border-radius: 8px; padding: 1.5rem;
    min-height: 300px;
}

/* Todo Panel */
.todo-input { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.todo-input input { flex: 1; padding: 0.75rem; background: var(--bg-dark); border: 1px solid #333; border-radius: 6px; color: white; }
.todo-input button { background: var(--accent); color: var(--bg-dark); border: none; padding: 0.75rem 1.5rem; border-radius: 6px; cursor: pointer; }
#todo-list { list-style: none; }
#todo-list li {
    background: var(--bg-dark); padding: 1rem; margin-bottom: 0.5rem; border-radius: 6px;
    display: flex; align-items: center; gap: 1rem;
}
#todo-list li.completed { opacity: 0.5; text-decoration: line-through; }
#todo-list input[type="checkbox"] { width: 20px; height: 20px; }

/* Needs List */
.needs-item {
    background: var(--bg-dark); border-left: 3px solid var(--danger);
    padding: 1rem; margin-bottom: 0.5rem; border-radius: 0 6px 6px 0;
}
.needs-item .agent { color: var(--accent); font-weight: bold; }

/* Needs Bar */
.needs-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(255, 68, 68, 0.9); color: white;
    padding: 1rem 2rem; display: none; justify-content: center; align-items: center; gap: 2rem;
}
.needs-bar.visible { display: flex; }
.needs-bar .close { cursor: pointer; font-size: 1.5rem; line-height: 1; }

.hidden { display: none !important; }
