/* ============================================================
   LIFELINE HOSPITAL - Hospital Tycoon Simulator
   Created by JH Games
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Orbitron:wght@400;500;600;700&display=swap');

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

body {
  font-family: 'Rajdhani', sans-serif;
  background: #0a1628;
  color: #e0e8f0;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: none;
}

/* ===== LOGIN SCREEN ===== */
#login-screen {
  position: fixed; inset: 0; z-index: 10000;
  background: linear-gradient(135deg, #0a1628 0%, #1a2a4a 50%, #0a1628 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
#login-screen .logo-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 36px; font-weight: 700;
  color: #4fc3f7; text-shadow: 0 0 20px #4fc3f766, 0 0 40px #4fc3f733;
  margin-bottom: 4px; letter-spacing: 3px;
}
#login-screen .logo-sub {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px; color: #4fc3f788; margin-bottom: 28px; letter-spacing: 2px;
}
#login-screen .jh-label {
  font-size: 11px; color: #556; margin-bottom: 20px; letter-spacing: 1px;
}
#login-screen input {
  font-family: 'Rajdhani', sans-serif; font-size: 15px;
  padding: 10px 16px; background: #0d1e36; color: #4fc3f7;
  border: 1px solid #4fc3f744; outline: none; width: 240px;
  margin-bottom: 10px; text-align: center; border-radius: 4px;
}
#login-screen input:focus { border-color: #4fc3f7aa; box-shadow: 0 0 8px #4fc3f733; }
#login-screen input::placeholder { color: #4fc3f755; }
#login-screen .login-btns { display: flex; gap: 10px; margin-bottom: 10px; }
#login-screen .login-btns button {
  font-family: 'Rajdhani', sans-serif; font-size: 13px; font-weight: 600;
  padding: 8px 24px; background: #0d1e36; color: #4fc3f7;
  border: 1px solid #4fc3f7; cursor: pointer; border-radius: 4px;
  transition: all 0.2s; letter-spacing: 1px;
}
#login-screen .login-btns button:hover { background: #4fc3f722; }
#login-screen #btn-guest {
  font-family: 'Rajdhani', sans-serif; font-size: 12px;
  padding: 6px 18px; background: none; color: #556;
  border: 1px dashed #334; cursor: pointer; border-radius: 4px;
  margin-bottom: 10px; transition: all 0.2s;
}
#login-screen #btn-guest:hover { color: #889; border-color: #556; }
#login-msg { font-size: 12px; color: #ff4444; min-height: 18px; margin-top: 6px; }
.login-footer { font-size: 9px; color: #334; margin-top: 16px; }
.login-credits { font-size: 10px; color: #ffd700; margin-top: 18px; }
.login-cross { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); font-size: 40px; color: #4fc3f722; }

/* ===== GAME CONTAINER ===== */
#game-container { display: none; width: 100vw; height: 100vh; flex-direction: column; }
#game-container.active { display: flex; }

/* ===== TOP BAR ===== */
#top-bar {
  height: 44px; background: #0d1e36; border-bottom: 1px solid #1a3a5c;
  display: flex; align-items: center; padding: 0 12px; gap: 16px; flex-shrink: 0;
  z-index: 100;
}
#top-bar .bar-item {
  display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 500;
}
#top-bar .bar-label { color: #6a8aaa; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
#top-bar .bar-value { color: #4fc3f7; font-weight: 600; }
#top-bar .bar-value.money { color: #66bb6a; }
#top-bar .bar-value.rep { color: #ffd54f; }
#top-bar .bar-value.patients { color: #ef5350; }
#top-bar .bar-spacer { flex: 1; }
#top-bar .speed-controls { display: flex; gap: 4px; }
#top-bar .speed-btn {
  font-family: 'Rajdhani', sans-serif; font-size: 11px; font-weight: 600;
  padding: 3px 8px; background: #162840; color: #6a8aaa;
  border: 1px solid #1a3a5c; cursor: pointer; border-radius: 3px;
  transition: all 0.15s;
}
#top-bar .speed-btn:hover { background: #1a3a5c; color: #4fc3f7; }
#top-bar .speed-btn.active { background: #4fc3f7; color: #0a1628; border-color: #4fc3f7; }

/* ===== MAIN AREA ===== */
#main-area {
  flex: 1; display: flex; overflow: hidden; position: relative;
}

/* ===== LEFT PANEL ===== */
#left-panel {
  width: 220px; background: #0d1e36; border-right: 1px solid #1a3a5c;
  display: flex; flex-direction: column; flex-shrink: 0; overflow: hidden;
  z-index: 50;
}
#left-panel .panel-tabs {
  display: flex; border-bottom: 1px solid #1a3a5c;
}
#left-panel .panel-tab {
  flex: 1; padding: 8px 4px; text-align: center; font-size: 11px; font-weight: 600;
  color: #6a8aaa; cursor: pointer; border-bottom: 2px solid transparent;
  transition: all 0.15s; letter-spacing: 0.5px;
}
#left-panel .panel-tab:hover { color: #4fc3f7; background: #162840; }
#left-panel .panel-tab.active { color: #4fc3f7; border-bottom-color: #4fc3f7; }
.left-content { flex: 1; overflow-y: auto; padding: 8px; }
.left-content::-webkit-scrollbar { width: 4px; }
.left-content::-webkit-scrollbar-track { background: #0d1e36; }
.left-content::-webkit-scrollbar-thumb { background: #1a3a5c; border-radius: 2px; }
.left-section { display: none; }
.left-section.active { display: block; }

/* Build items */
.build-item {
  padding: 8px; margin-bottom: 4px; background: #162840; border: 1px solid #1a3a5c;
  border-radius: 4px; cursor: pointer; transition: all 0.15s;
}
.build-item:hover { border-color: #4fc3f7; background: #1a3a5c; }
.build-item.selected { border-color: #4fc3f7; background: #4fc3f722; }
.build-item .item-name { font-size: 12px; font-weight: 600; color: #e0e8f0; }
.build-item .item-cost { font-size: 11px; color: #66bb6a; }
.build-item .item-desc { font-size: 10px; color: #6a8aaa; margin-top: 2px; }
.build-item .item-color {
  display: inline-block; width: 10px; height: 10px; border-radius: 2px;
  margin-right: 4px; vertical-align: middle;
}

/* Staff items */
.staff-card {
  padding: 8px; margin-bottom: 4px; background: #162840; border: 1px solid #1a3a5c;
  border-radius: 4px; cursor: pointer; transition: all 0.15s;
}
.staff-card:hover { border-color: #4fc3f7; }
.staff-card .staff-name { font-size: 12px; font-weight: 600; }
.staff-card .staff-role { font-size: 10px; color: #6a8aaa; }
.staff-card .staff-stat { font-size: 10px; display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.staff-card .stat-bar { flex: 1; height: 4px; background: #0d1e36; border-radius: 2px; overflow: hidden; }
.staff-card .stat-fill { height: 100%; border-radius: 2px; }

/* Research items */
.research-item {
  padding: 8px; margin-bottom: 4px; background: #162840; border: 1px solid #1a3a5c;
  border-radius: 4px; cursor: pointer; transition: all 0.15s;
}
.research-item:hover { border-color: #ab47bc; }
.research-item.unlocked { opacity: 0.5; border-color: #66bb6a; }
.research-item .res-name { font-size: 12px; font-weight: 600; color: #ce93d8; }
.research-item .res-cost { font-size: 11px; color: #ab47bc; }
.research-item .res-desc { font-size: 10px; color: #6a8aaa; margin-top: 2px; }

/* ===== CANVAS AREA ===== */
#canvas-wrap {
  flex: 1; position: relative; overflow: hidden; background: #060e1a;
}
#game-canvas {
  position: absolute; top: 0; left: 0; image-rendering: pixelated;
}
#canvas-overlay {
  position: absolute; top: 8px; left: 8px; pointer-events: none;
  font-size: 11px; color: #4fc3f788;
}
#build-hint {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  font-size: 12px; color: #ffd54f; background: #0d1e36dd; padding: 6px 16px;
  border-radius: 4px; border: 1px solid #ffd54f44; display: none;
  pointer-events: none;
}

/* ===== RIGHT PANEL ===== */
#right-panel {
  width: 240px; background: #0d1e36; border-left: 1px solid #1a3a5c;
  display: flex; flex-direction: column; flex-shrink: 0; overflow: hidden;
  z-index: 50;
}
#right-panel .rp-header {
  padding: 8px 12px; font-size: 12px; font-weight: 600; color: #4fc3f7;
  border-bottom: 1px solid #1a3a5c; text-transform: uppercase; letter-spacing: 1px;
}
#right-panel .rp-content {
  flex: 1; overflow-y: auto; padding: 8px;
}
#right-panel .rp-content::-webkit-scrollbar { width: 4px; }
#right-panel .rp-content::-webkit-scrollbar-track { background: #0d1e36; }
#right-panel .rp-content::-webkit-scrollbar-thumb { background: #1a3a5c; border-radius: 2px; }
.info-row {
  display: flex; justify-content: space-between; padding: 3px 0;
  font-size: 11px; border-bottom: 1px solid #1a3a5c11;
}
.info-row .ir-label { color: #6a8aaa; }
.info-row .ir-value { color: #e0e8f0; font-weight: 500; }
.info-section-title {
  font-size: 11px; font-weight: 600; color: #4fc3f7; margin: 8px 0 4px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.patient-queue-item {
  padding: 6px 8px; margin-bottom: 3px; background: #162840;
  border-radius: 3px; font-size: 11px; border-left: 3px solid #4fc3f7;
}
.patient-queue-item.urgent { border-left-color: #ef5350; }
.patient-queue-item .pq-name { font-weight: 600; }
.patient-queue-item .pq-illness { color: #6a8aaa; font-size: 10px; }
.patient-queue-item .pq-patience {
  width: 100%; height: 3px; background: #0d1e36; border-radius: 2px;
  margin-top: 3px; overflow: hidden;
}
.patient-queue-item .pq-patience-fill {
  height: 100%; background: #66bb6a; border-radius: 2px; transition: width 0.3s;
}

/* ===== BOTTOM BAR ===== */
#bottom-bar {
  height: 100px; background: #0d1e36; border-top: 1px solid #1a3a5c;
  display: flex; flex-shrink: 0; z-index: 50;
}
#notification-log {
  flex: 1; overflow-y: auto; padding: 6px 12px; font-size: 11px;
}
#notification-log::-webkit-scrollbar { width: 4px; }
#notification-log::-webkit-scrollbar-track { background: #0d1e36; }
#notification-log::-webkit-scrollbar-thumb { background: #1a3a5c; border-radius: 2px; }
.notif-item { padding: 2px 0; color: #6a8aaa; border-bottom: 1px solid #1a3a5c11; }
.notif-item.good { color: #66bb6a; }
.notif-item.bad { color: #ef5350; }
.notif-item.warn { color: #ffd54f; }
.notif-item.event { color: #ce93d8; }
.notif-time { color: #3a5a7a; margin-right: 6px; }
#financial-summary {
  width: 280px; border-left: 1px solid #1a3a5c; padding: 6px 12px;
  font-size: 11px; overflow-y: auto;
}
#financial-summary .fs-title {
  font-size: 11px; font-weight: 600; color: #66bb6a; margin-bottom: 4px;
  text-transform: uppercase; letter-spacing: 0.5px;
}

/* ===== POPUPS ===== */
.popup-overlay {
  position: fixed; inset: 0; background: #000000aa; z-index: 5000;
  display: flex; align-items: center; justify-content: center;
}
.popup-overlay.hidden { display: none; }
.popup-box {
  background: #0d1e36; border: 1px solid #1a3a5c; border-radius: 8px;
  padding: 24px; max-width: 500px; width: 90%; max-height: 80vh;
  overflow-y: auto; box-shadow: 0 8px 32px #000000aa;
}
.popup-box::-webkit-scrollbar { width: 4px; }
.popup-box::-webkit-scrollbar-thumb { background: #1a3a5c; border-radius: 2px; }
.popup-title {
  font-family: 'Orbitron', sans-serif; font-size: 18px; font-weight: 600;
  color: #4fc3f7; margin-bottom: 12px; text-align: center;
}
.popup-text { font-size: 13px; color: #b0c0d0; line-height: 1.6; margin-bottom: 16px; }
.popup-btn {
  font-family: 'Rajdhani', sans-serif; font-size: 13px; font-weight: 600;
  padding: 8px 24px; background: #4fc3f7; color: #0a1628;
  border: none; border-radius: 4px; cursor: pointer; margin: 0 4px;
  transition: all 0.15s; letter-spacing: 0.5px;
}
.popup-btn:hover { background: #81d4fa; }
.popup-btn.danger { background: #ef5350; color: #fff; }
.popup-btn.danger:hover { background: #f44336; }
.popup-btn.secondary { background: #162840; color: #6a8aaa; border: 1px solid #1a3a5c; }
.popup-btn.secondary:hover { background: #1a3a5c; color: #4fc3f7; }
.popup-actions { text-align: center; margin-top: 16px; }

/* Event popup */
.event-popup {
  position: fixed; top: 80px; right: 260px; z-index: 4000;
  background: #1a0a2a; border: 2px solid #ce93d8; border-radius: 8px;
  padding: 16px; width: 300px; box-shadow: 0 4px 24px #000000aa;
  animation: slideIn 0.3s ease-out;
}
.event-popup.hidden { display: none; }
.event-popup .ep-title {
  font-family: 'Orbitron', sans-serif; font-size: 14px; font-weight: 600;
  color: #ce93d8; margin-bottom: 8px;
}
.event-popup .ep-text { font-size: 12px; color: #b0a0c0; margin-bottom: 12px; line-height: 1.5; }
.event-popup .ep-timer { font-size: 11px; color: #ffd54f; margin-bottom: 8px; }

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

/* ===== ADMIN PANEL ===== */
#admin-panel {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 9000; background: #0d1e36; border: 2px solid #ffd54f;
  border-radius: 8px; padding: 20px; width: 400px;
  box-shadow: 0 8px 32px #000000cc; display: none;
}
#admin-panel.active { display: block; }
#admin-panel .admin-title {
  font-family: 'Orbitron', sans-serif; font-size: 16px; font-weight: 600;
  color: #ffd54f; text-align: center; margin-bottom: 16px;
}
#admin-panel .admin-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
#admin-panel .admin-btn {
  font-family: 'Rajdhani', sans-serif; font-size: 12px; font-weight: 600;
  padding: 10px 8px; background: #162840; color: #ffd54f;
  border: 1px solid #ffd54f44; border-radius: 4px; cursor: pointer;
  transition: all 0.15s; text-align: center;
}
#admin-panel .admin-btn:hover { background: #ffd54f22; border-color: #ffd54f; }
#admin-panel .admin-btn.toggle-on { background: #ffd54f33; border-color: #ffd54f; color: #fff; }

/* ===== HIRE POPUP ===== */
.hire-candidate {
  padding: 10px; margin-bottom: 6px; background: #162840;
  border: 1px solid #1a3a5c; border-radius: 4px; cursor: pointer;
  transition: all 0.15s; display: flex; justify-content: space-between; align-items: center;
}
.hire-candidate:hover { border-color: #4fc3f7; }
.hire-candidate .hc-info { flex: 1; }
.hire-candidate .hc-name { font-size: 13px; font-weight: 600; }
.hire-candidate .hc-role { font-size: 11px; color: #6a8aaa; }
.hire-candidate .hc-skill { font-size: 11px; color: #ffd54f; }
.hire-candidate .hc-salary { font-size: 12px; color: #66bb6a; font-weight: 600; }

/* ===== TOOLTIP ===== */
#tooltip {
  position: fixed; z-index: 8000; background: #0d1e36ee;
  border: 1px solid #1a3a5c; border-radius: 4px; padding: 8px 12px;
  font-size: 11px; color: #e0e8f0; pointer-events: none;
  max-width: 200px; display: none; box-shadow: 0 4px 12px #00000066;
}

/* ===== FOOTER ===== */
#game-footer {
  position: absolute; bottom: 4px; right: 8px; font-size: 9px;
  color: #ffd700; z-index: 100; pointer-events: none;
}

/* ===== SCROLLBARS ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0a1628; }
::-webkit-scrollbar-thumb { background: #1a3a5c; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #2a4a6c; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  #left-panel { width: 180px; }
  #right-panel { width: 200px; }
}

/* ===== ROOM ASSIGN DROPDOWN ===== */
.room-assign-select {
  font-family: 'Rajdhani', sans-serif; font-size: 11px;
  background: #162840; color: #e0e8f0; border: 1px solid #1a3a5c;
  border-radius: 3px; padding: 3px 6px; width: 100%; margin-top: 4px;
  cursor: pointer;
}

/* ===== LOAN POPUP ===== */
.loan-option {
  padding: 10px; margin-bottom: 6px; background: #162840;
  border: 1px solid #1a3a5c; border-radius: 4px; cursor: pointer;
  transition: all 0.15s;
}
.loan-option:hover { border-color: #66bb6a; }
.loan-option .lo-amount { font-size: 14px; font-weight: 600; color: #66bb6a; }
.loan-option .lo-details { font-size: 11px; color: #6a8aaa; }

/* ===== MISC ===== */
.hidden { display: none !important; }
.pulse { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
