/* PC Game Office Style - Theme Hospital / Sims vibes */
:root {
  --bg-wall: #2c3e50;
  --bg-floor: #34495e;
  --desk-wood: #8b4513;
  --desk-dark: #5d2e0c;
  --carpet: #1a252f;
  --window: #87ceeb;
  --window-night: #2c3e50;
  
  --agent-working: #27ae60;
  --agent-idle: #f39c12;
  --agent-ooo: #7f8c8d;
  --agent-selected: #3498db;
  
  --ui-dark: #1a1a2e;
  --ui-border: #4a4a6a;
  --ui-highlight: #6a6a8a;
  --ui-text: #e0e0e0;
  --ui-text-dim: #888;
}

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

body {
  background: linear-gradient(135deg, #0a0a12 0%, #1a1a2e 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Segoe UI', 'Trebuchet MS', sans-serif;
  color: var(--ui-text);
  padding: 20px;
}

.game-container {
  background: var(--ui-dark);
  border: 3px solid var(--ui-border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 
    0 0 0 2px #000,
    0 20px 60px rgba(0,0,0,0.8),
    inset 0 1px 0 rgba(255,255,255,0.1);
}

.header-bar {
  background: linear-gradient(180deg, #3a3a5a 0%, #2a2a4a 100%);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--ui-border);
}

.header-bar h1 {
  font-size: 18px;
  font-weight: : var(--ui600;
  color-text);
  text-shadow: 0 1px 2px #000;
}

.header-bar .clock {
  font-size: 14px;
  color: var(--ui-highlight);
  font-family: monospace;
}

.screen {
  width: 720px;
  height: 480px;
  position: relative;
  overflow: hidden;
  cursor: default;
}

/* Office Background */
.office {
  width: 100%;
  height: 100%;
  position: relative;
  background: linear-gradient(180deg, var(--bg-wall) 0%, var(--bg-wall) 65%, var(--carpet) 65%, var(--carpet) 100%);
}

/* Windows */
.window {
  position: absolute;
  top: 20px;
  width: 120px;
  height: 100px;
  background: var(--window);
  border: 6px solid var(--desk-wood);
  box-shadow: inset 0 0 20px rgba(255,255,255,0.3);
}

.window::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  background: var(--desk-wood);
  transform: translateX(-50%);
}

.window::before {
  content: '';
  position: absolute;
  top: 50%;
  width: 100%;
  height: 4px;
  background: var(--desk-wood);
  transform: translateY(-50%);
  z-index: 1;
}

.window:nth-child(1) { left: 40px; }
.window:nth-child(2) { left: 200px; }
.window:nth-child(3) { right: 200px; }
.window:nth-child(4) { right: 40px; }

/* Floor carpet pattern */
.office::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 35%;
  background: 
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 40px,
      rgba(0,0,0,0.1) 40px,
      rgba(0,0,0,0.1) 42px
    );
  pointer-events: none;
}

/* Desks */
.desk {
  position: absolute;
  width: 90px;
  height: 60px;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s;
}

.desk:hover {
  transform: scale(1.05);
  filter: brightness(1.2);
}

.desk.selected {
  filter: brightness(1.3) drop-shadow(0 0 8px var(--agent-selected));
}

.desk-body {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 35px;
  background: linear-gradient(180deg, var(--desk-wood) 0%, var(--desk-dark) 100%);
  border-radius: 2px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

.desk-top {
  position: absolute;
  bottom: 32px;
  left: -4px;
  width: calc(100% + 8px);
  height: 8px;
  background: linear-gradient(180deg, #a0522d 0%, var(--desk-wood) 100%);
  border-radius: 2px;
}

.desk-monitor {
  position: absolute;
  bottom: 38px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 28px;
  background: #1a1a1a;
  border: 2px solid #333;
  border-radius: 2px;
}

.desk-monitor::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 14px;
  background: linear-gradient(180deg, #2c3e50 0%, #1a252f 100%);
}

.desk-monitor::before {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 6px;
  background: #333;
  border-radius: 0 0 2px 2px;
}

.desk-label {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  color: #ddd;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
}

.desk-context-pct {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 14px;
  line-height: 1;
  text-shadow: 0 1px 2px #000;
}

.desk-state-indicator {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--ui-dark);
}

.desk-state-indicator.working { background: var(--agent-working); box-shadow: 0 0 6px var(--agent-working); }
.desk-state-indicator.idle { background: var(--agent-idle); }
.desk-state-indicator.ooo { background: var(--agent-ooo); }

.desk-last-active {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--ui-text-dim);
  white-space: nowrap;
}

/* Agents - BIG GEESE */
.agent {
  position: absolute;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  z-index: 10;
  transition: left 0.4s ease-out, top 0.4s ease-out;
  cursor: pointer;
}

/* Bobbing animation - slight up/down movement */
.agent.bobbing {
  animation: bob 1.2s ease-in-out infinite;
}

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

/* Snoring animation for idle >15 min */
.agent.snoring {
  animation: snore 2s ease-in-out infinite;
}

@keyframes snore {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-2px) rotate(-3deg); }
  75% { transform: translateY(-2px) rotate(3deg); }
}

.agent.snoring::after {
  content: '💤';
  position: absolute;
  top: -8px;
  right: -12px;
  font-size: 16px;
  animation: snore-z 1.5s ease-in-out infinite;
}

@keyframes snore-z {
  0% { opacity: 0; transform: translateY(4px) scale(0.8); }
  50% { opacity: 1; transform: translateY(-2px) scale(1); }
  100% { opacity: 0; transform: translateY(-8px) scale(0.8); }
}

.agent:hover {
  transform: scale(1.2);
}

.agent.working {
  animation: heartbeat 0.8s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.agent-bubble {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  color: #333;
  padding: 3px 8px;
  font-size: 10px;
  border-radius: 10px;
  white-space: nowrap;
  font-family: sans-serif;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  animation: bubble-pop 0.2s ease-out;
  z-index: 11;
}

.agent-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid white;
}

@keyframes bubble-pop {
  from { transform: translateX(-50%) scale(0); }
  to { transform: translateX(-50%) scale(1); }
}

/* Info Panel (right side) */
.info-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 180px;
  height: 100%;
  background: linear-gradient(180deg, #1e1e2e 0%, #16162a 100%);
  border-left: 2px solid var(--ui-border);
  padding: 10px;
  overflow-y: auto;
}

.info-panel h3 {
  font-size: 12px;
  color: var(--ui-highlight);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ui-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sort-controls {
  display: flex;
  gap: 4px;
}

.sort-btn {
  background: #222;
  border: 1px solid #444;
  color: #888;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3px;
  cursor: pointer;
}

.sort-btn:hover {
  background: #333;
  color: #0f0;
}

.info-panel .agent-info {
  margin-bottom: 16px;
}

.info-panel .info-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 4px;
}

.info-panel .info-label { color: var(--ui-text-dim); }
.info-panel .info-value { color: var(--ui-text); font-family: monospace; }

/* Radar - Left side */
.radar {
  position: absolute;
  bottom: 8px;
  left: 8px;
  width: 100px;
  height: 80px;
  background: rgba(0,20,0,0.9);
  border: 2px solid #0f0;
  border-radius: 4px;
  overflow: hidden;
}

.radar-title {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 8px;
  color: #0f0;
  font-family: monospace;
  z-index: 5;
}

.radar-grid {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: 
    linear-gradient(90deg, rgba(0,255,0,0.15) 1px, transparent 1px),
    linear-gradient(rgba(0,255,0,0.15) 1px, transparent 1px);
  background-size: 20px 16px;
}

.radar-dots {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
}

.radar-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.radar-dot.working { background: var(--agent-working); box-shadow: 0 0 6px var(--agent-working); }
.radar-dot.idle { background: var(--agent-idle); }
.radar-dot.ooo { background: var(--agent-ooo); }

.radar-sweep {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50%;
  height: 2px;
  background: linear-gradient(90deg, rgba(0,255,0,0.8), transparent);
  transform-origin: left center;
  animation: sweep 3s linear infinite;
}

@keyframes sweep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Status Bar */
.status-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 180px;
  height: 28px;
  background: linear-gradient(180deg, #2a2a4a 0%, #1a1a2e 100%);
  border-top: 2px solid var(--ui-border);
  font-size: 11px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 20px;
}

.status-bar .stat {
  display: flex;
  gap: 6px;
}

.status-bar .stat-label { color: var(--ui-text-dim); }
.status-bar .stat-value { color: var(--ui-text); }
.status-bar .stat-value.active { color: var(--agent-working); }
.status-bar .stat-value.idle { color: var(--agent-idle); }
.status-bar .stat-value.ooo { color: var(--agent-ooo); }

/* Click feedback */
.click-feedback {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid var(--agent-selected);
  border-radius: 50%;
  animation: click-ripple 0.4s ease-out forwards;
  pointer-events: none;
}

@keyframes click-ripple {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

/* Files List in Info Panel */
.files-list {
  max-height: 250px;
  overflow-y: auto;
  background: rgba(0,0,0,0.2);
  border-radius: 4px;
  padding: 4px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  font-size: 10px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.15s;
}

.file-item:hover {
  background: rgba(255,255,255,0.1);
}

.file-icon {
  flex-shrink: 0;
  font-size: 12px;
}

.file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ui-text);
}

.file-size {
  color: var(--ui-text-dim);
  font-size: 9px;
  flex-shrink: 0;
}

.file-item.expanded .file-header {
  border-bottom: 1px solid var(--ui-border);
  margin-bottom: 4px;
  padding-bottom: 4px;
}

/* File Preview Modal Overlay */
.file-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.file-modal-overlay.active {
  display: flex;
}

.file-modal {
  background: #0a0a0a;
  border: 2px solid #0f0;
  border-radius: 8px;
  width: 80%;
  max-width: 800px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(0,255,0,0.3);
}

.file-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
  border-radius: 6px 6px 0 0;
}

.file-modal-title {
  font-size: 14px;
  font-weight: 600;
  color: #0f0;
}

.file-modal-close {
  background: none;
  border: none;
  color: #666;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
}

.file-modal-close:hover {
  color: #f00;
}

.file-modal-content {
  flex: 1;
  overflow: auto;
  padding: 16px;
  font-size: 13px;
  font-family: 'Consolas', 'Monaco', monospace;
  color: #0f0;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.5;
}

.file-header {
  display: flex;
  align-items: center;
  gap: 6px;
}
