/* Master Dashboard — Metro Style */

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

html, body {
  height: 100%;
  background: #1a1a2e;
  color: #ffffff;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 40px 40px 20px;
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* OJ Buddy Widget */
.oj-buddy {
  width: 140px;
  height: 160px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#oj-face-container {
  width: 120px;
  height: 120px;
  position: relative;
}
.oj-face {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}
.oj-face.oj-active { opacity: 1; }
.oj-face.oj-exiting { opacity: 0; }
@keyframes oj-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}
.oj-face.oj-active.oj-pulsing {
  animation: oj-pulse 3.5s ease-in-out infinite;
}
#oj-state-label {
  margin-top: 4px;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.5;
  text-align: center;
}

/* Tile Grid */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  padding: 20px 40px 40px;
}

/* Tiles */
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  min-height: 150px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease, filter 0.2s ease;
  overflow: hidden;
}

.tile:hover {
  transform: scale(1.02);
  filter: brightness(1.1);
}

.tile:active {
  transform: scale(0.98);
  filter: brightness(0.95);
}

.tile-1x1 { grid-column: span 1; grid-row: span 1; }
.tile-2x1 { grid-column: span 2; grid-row: span 1; }
.tile-2x2 { grid-column: span 2; grid-row: span 2; min-height: 312px; }

.tile .tile-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.tile .tile-subtitle {
  font-size: 0.8rem;
  opacity: 0.7;
  margin-top: 4px;
}

.tile .tile-icon {
  font-size: 3rem;
  position: absolute;
  top: 20px;
  left: 20px;
  opacity: 0.6;
}

/* Tile colors */
#skills-tile  { background: #2d89ef; }
#agents-tile  { background: #00a300; }

/* Placeholder / future tiles */
.tile-placeholder {
  border: 2px dashed rgba(255,255,255,0.15);
  background: transparent;
  min-height: 150px;
  cursor: default;
}
.tile-placeholder:hover { transform: none; filter: none; }

/* Detail Overlay */
.detail-overlay {
  position: fixed;
  top: 0; right: 0;
  width: 50%;
  height: 100%;
  background: #16213e;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 1000;
  padding: 40px;
  overflow-y: auto;
  box-shadow: -4px 0 30px rgba(0,0,0,0.5);
}

.detail-overlay.open {
  transform: translateX(0);
}

.overlay-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.overlay-close:hover { opacity: 1; }

#detail-content {
  margin-top: 40px;
}

/* Responsive */
@media (max-width: 600px) {
  .header { padding: 16px; font-size: 1.1rem; }
  .oj-buddy { width: 100px; height: 120px; }
  #oj-face-container { width: 90px; height: 90px; }
  .tile-grid { padding: 12px; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .tile-2x2 { min-height: 250px; }
  .detail-overlay { width: 100%; }
}
