/* ==========================================================================
   AZITO 3 - Secret Base Defense System CSS
   ========================================================================== */

:root {
  --bg-dark: #090d16;
  --bg-panel: #111827;
  --bg-card: #1f2937;
  --border-color: #374151;
  --border-focus: #38bdf8;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  
  --color-primary: #3b82f6;
  --color-success: #22c55e;
  --color-warning: #eab308;
  --color-danger: #ef4444;
  --color-info: #06b6d4;

  --font-mono: 'JetBrains Mono', 'Courier New', Courier, monospace;
  --font-ui: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-ui);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

#app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* ==========================================================================
   Top HUD Bar
   ========================================================================== */
#hud-header {
  background: linear-gradient(180deg, #161f30 0%, #0d131f 100%);
  border-bottom: 2px solid #1e293b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  gap: 12px;
  z-index: 10;
  flex-shrink: 0;
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-logo-icon {
  font-size: 24px;
  background: #ef4444;
  color: white;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.hud-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #ffffff;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.hud-subtitle {
  font-size: 9px;
  letter-spacing: 1px;
  color: #94a3b8;
  display: block;
}

.hud-metrics {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.metric-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

.metric-icon {
  font-size: 20px;
}

.metric-data {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.metric-val {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
}

.metric-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.metric-research {
  min-width: 170px;
}

.hud-progress-bg {
  width: 100%;
  height: 6px;
  background: #1e293b;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 3px;
}

.hud-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #06b6d4, #38bdf8);
  transition: width 0.3s ease;
}

.metric-subval {
  font-size: 10px;
  font-family: var(--font-mono);
  color: #38bdf8;
}

.hud-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.speed-control-group {
  display: flex;
  border: 1px solid #334155;
  border-radius: 6px;
  overflow: hidden;
  margin-left: 6px;
}

.btn-speed {
  background: #1e293b;
  color: var(--text-muted);
  border: none;
  padding: 6px 9px;
  font-size: 11px;
  cursor: pointer;
  border-right: 1px solid #334155;
  transition: all 0.15s ease;
}

.btn-speed:last-child {
  border-right: none;
}

.btn-speed:hover {
  background: #334155;
  color: #ffffff;
}

.btn-speed.active {
  background: var(--color-primary);
  color: #ffffff;
  font-weight: bold;
}

/* ==========================================================================
   Main Game Workspace
   ========================================================================== */
#game-workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
  background: #020617;
}

#canvas-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: auto;
  padding: 12px;
}

#game-canvas {
  background: #000000;
  border: 2px solid #334155;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8), inset 0 0 16px rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  cursor: crosshair;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.canvas-legend {
  display: flex;
  gap: 20px;
  margin-top: 8px;
  font-size: 11px;
  color: #64748b;
  font-family: var(--font-mono);
}

/* ==========================================================================
   Sidebar / Inspector Panel
   ========================================================================== */
#inspector-sidebar {
  width: 320px;
  background: var(--bg-panel);
  border-left: 2px solid #1e293b;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-header {
  padding: 12px 16px;
  background: #0f172a;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
  font-size: 13px;
  letter-spacing: 1px;
  color: #94a3b8;
}

#info-panel {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.empty-state {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  padding: 30px 10px;
}

.quick-guide {
  margin-top: 24px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 12px;
  text-align: left;
}

.tip-tag {
  display: inline-block;
  background: #38bdf8;
  color: #0f172a;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 3px;
  margin-bottom: 6px;
}

.panel-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.card-header h3 {
  font-size: 15px;
  color: #ffffff;
}

.desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.control-section {
  background: #1e293b;
  border-radius: 6px;
  padding: 10px;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-section h4 {
  font-size: 12px;
  letter-spacing: 0.5px;
  color: #93c5fd;
}

.staff-tag-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.staff-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
}

.btn-tag-remove {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-weight: bold;
  padding: 0 4px;
}

.assign-action {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.form-select {
  background: #0f172a;
  color: #ffffff;
  border: 1px solid #334155;
  border-radius: 4px;
  padding: 6px;
  font-size: 12px;
  width: 100%;
}

.warehouse-stock {
  font-size: 11px;
  color: #94a3b8;
  background: #0f172a;
  padding: 6px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-actions {
  margin-top: 10px;
}

/* ==========================================================================
   Bottom Construction Toolbar
   ========================================================================== */
#build-toolbar {
  background: #0f172a;
  border-top: 2px solid #1e293b;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  z-index: 10;
}

.toolbar-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #64748b;
  white-space: nowrap;
}

.toolbar-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.btn-toolbar {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-toolbar:hover {
  background: #334155;
  border-color: #64748b;
  transform: translateY(-1px);
}

.btn-toolbar.active {
  background: #1e3a8a;
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.btn-tool-demolish.active {
  background: #7f1d1d;
  border-color: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.tool-icon {
  font-size: 16px;
}

.tool-name {
  font-size: 12px;
  font-weight: 600;
}

.tool-cost {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #38bdf8;
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 4px;
  border-radius: 3px;
}

.toolbar-hint {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
}

/* ==========================================================================
   Buttons & Badges
   ========================================================================== */
.btn {
  background: var(--bg-card);
  color: #ffffff;
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn:hover {
  background: #374151;
  border-color: #6b7280;
}

.btn-primary {
  background: #2563eb;
  border-color: #3b82f6;
}
.btn-primary:hover {
  background: #1d4ed8;
}

.btn-danger {
  background: #dc2626;
  border-color: #ef4444;
}
.btn-danger:hover {
  background: #b91c1c;
}

.btn-warning {
  background: #d97706;
  border-color: #f59e0b;
  color: white;
}
.btn-warning:hover {
  background: #b45309;
}

.btn-secondary {
  background: #1e293b;
  border-color: #475569;
}
.btn-secondary:hover {
  background: #334155;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 11px;
}

.btn-lg {
  padding: 10px 20px;
  font-size: 14px;
}

.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

.badge-success { background: #166534; color: #86efac; }
.badge-danger { background: #991b1b; color: #fca5a5; }
.badge-warning { background: #854d0e; color: #fde047; }
.badge-info { background: #155e75; color: #a5f3fc; }
.badge-secondary { background: #334155; color: #cbd5e1; }

.alert-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.alert-warning {
  background: #f59e0b;
  color: #000000;
}

.alert-danger {
  background: #ef4444;
  color: #ffffff;
}

.pulse {
  animation: pulseAnim 1s infinite alternate;
}

@keyframes pulseAnim {
  0% { opacity: 0.7; transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1.03); }
}

.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }
.text-info { color: var(--color-info); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

/* ==========================================================================
   Modals
   ========================================================================== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-dialog {
  background: #111827;
  border: 2px solid #38bdf8;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(56, 189, 248, 0.2);
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-danger {
  border-color: #ef4444;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.4);
}

.modal-success {
  border-color: #22c55e;
  box-shadow: 0 0 30px rgba(34, 197, 94, 0.4);
}

.modal-header {
  padding: 14px 20px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 16px;
  color: #ffffff;
}

.modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
}

.modal-close:hover {
  color: #ffffff;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.roster-meta {
  background: #1e293b;
  border-radius: 6px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.roster-hire-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hire-buttons-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.roster-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.roster-item {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.roster-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}

.roster-item-actions {
  display: flex;
  gap: 6px;
}

.tech-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tech-card {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tech-card.completed {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.05);
}

.tech-card.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.tech-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tech-card-actions {
  margin-top: 4px;
  display: flex;
  justify-content: flex-end;
}

.stats-box {
  background: #1e293b;
  padding: 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #38bdf8;
  margin: 16px 0;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
#notifications {
  position: fixed;
  top: 64px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 150;
  pointer-events: none;
}

.toast {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid #334155;
  border-left: 4px solid #38bdf8;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  animation: slideIn 0.25s ease-out;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-success { border-left-color: #22c55e; }
.toast-danger { border-left-color: #ef4444; }
.toast-warning { border-left-color: #f59e0b; }

.toast.fade-out {
  opacity: 0;
  transform: translateX(30px);
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
