/* UI Panels - Blueprint / Technical Document Style */

#ui-container {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 300px;
  background: transparent;
  pointer-events: none; /* Let clicks pass through container gaps */
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Global Panel Style */
.gameplay-panel, #status-panel, .gameplay-panel-consolidated {
  background-color: rgba(26, 38, 52, 0.95); /* Matches bp-bg but opaque */
  border: 2px solid var(--bp-ink);
  color: var(--bp-ink);
  box-shadow: 4px 4px 0px rgba(0,0,0,0.3); /* Hard shadow for paper feel */
  border-radius: 2px; /* Slight rounding, mostly sharp */
  pointer-events: auto;
  position: absolute;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Header Typography */
h3, h4 {
  font-family: var(--font-hand);
  color: var(--bp-accent);
  margin: 0;
  letter-spacing: 1px;
  transform: rotate(-1deg); /* Slight organic tilt */
}

/* Status Panel (Top Left) */
#status-panel {
  top: 20px;
  left: 20px;
  width: 340px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  z-index: 20;
}

#status-header {
  padding: 15px;
  border-bottom: 2px dashed var(--bp-ink);
  background-color: rgba(255,255,255,0.05);
}

#status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
}

#timer {
  font-family: var(--font-tech);
  font-size: 1.4em;
  color: var(--bp-warn);
  text-shadow: 0 0 5px rgba(255, 230, 109, 0.3);
}

/* Consolidated Dashboard Positioning */
#gameplay-dashboard {
  top: 20px;
  right: 20px;
  width: 360px;
  bottom: 80px; /* Room for game-controls below */
  display: flex;
  flex-direction: column;
}

.dashboard-tabs {
  display: flex;
  border-bottom: 2px solid var(--bp-ink);
  background: rgba(255,255,255,0.05);
}

.dashboard-tab {
  flex: 1;
  border: none;
  border-right: 1px solid var(--bp-ink);
  padding: 10px 5px;
  font-family: var(--font-hand);
  font-size: 0.9em;
  background: transparent;
  color: var(--bp-ink);
  cursor: pointer;
  transition: background 0.2s;
}

.dashboard-tab:last-child {
  border-right: none;
}

.dashboard-tab.active {
  background: var(--bp-accent);
  color: var(--bp-bg);
}

.dashboard-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.tab-pane {
  display: none;
  height: 100%;
  flex-direction: column;
}

.tab-pane.active {
  display: flex;
}

.dashboard-sub-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.dashboard-sub-panel .panel-header h3 {
  font-family: var(--font-hand);
  font-size: 1.3em;
  margin-bottom: 5px;
}

/* Fix scrolling for consolidated lists */
.scrollable-list {
  flex: 1;
  overflow-y: auto;
  padding-right: 5px;
}

#intel-list-container {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#crew-list {
  margin-top: 15px;
  border-top: 1px dashed var(--bp-ink);
  padding-top: 10px;
  flex: 1;
  overflow-y: auto;
}

.recruit-search-bar {
  padding-bottom: 10px;
}

.crew-types {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.crew-type-btn {
  font-size: 0.8em;
  padding: 5px;
}

/* Panel Internals */
.panel-header {
  padding: 10px 15px;
  background-color: rgba(78, 205, 196, 0.1);
  border-bottom: 1px solid var(--bp-ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-hand);
}

.panel-toggle {
  background: none;
  border: 1px solid var(--bp-ink);
  color: var(--bp-ink);
  width: 24px;
  height: 24px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  font-weight: bold;
}

.panel-content {
  padding: 15px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.panel-expanded .panel-content {
  max-height: 60vh;
  overflow-y: auto;
}

/* Roster / Lists */
.multiplayer-roster {
  padding: 10px;
  background-image: linear-gradient(var(--bp-grid-minor) 1px, transparent 1px);
  background-size: 100% 20px; /* Notebook lines */
}

.player-card {
  background: transparent;
  border: 1px solid var(--bp-ink);
  padding: 10px;
  margin-bottom: 10px;
  position: relative;
}

.player-card.current-player {
  border: 2px solid var(--bp-accent);
  box-shadow: inset 0 0 10px rgba(78, 205, 196, 0.2);
}

.player-card::before {
  /* Tape effect */
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(2deg);
  width: 60px;
  height: 20px;
  background-color: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.1);
}

.card-header {
  border-bottom: 1px dotted var(--bp-ink);
  padding-bottom: 5px;
  margin-bottom: 5px;
}

.player-name {
  font-family: var(--font-hand);
  font-size: 1.1em;
}

#status-panel h2 {
  font-family: var(--font-hand);
  color: var(--bp-accent);
}

/* Buttons */
button {
  background: transparent;
  border: 2px solid var(--bp-ink);
  color: var(--bp-ink);
  font-family: var(--font-tech);
  font-weight: bold;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}

button:hover:not(:disabled) {
  background: var(--bp-ink);
  color: var(--bp-bg);
}

button:disabled {
  border-color: #555;
  color: #555;
  cursor: not-allowed;
}

.ready-button.ready {
  border-color: var(--bp-accent);
  color: var(--bp-accent);
}

.ready-button.ready:hover {
  background: var(--bp-accent);
  color: var(--bp-bg);
}

/* Specific Lists */
.intel-item {
  border-left: 3px solid var(--bp-ink);
  padding-left: 10px;
  margin-bottom: 15px;
}

.intel-item.owned {
  border-left-color: var(--bp-accent);
}

.security-item {
  border: 1px dashed var(--bp-ink);
  padding: 8px;
  margin-bottom: 8px;
}

.crew-list li {
  background: rgba(255,255,255,0.05);
  border: 1px solid transparent;
  margin-bottom: 4px;
}

/* Game Controls (Zoom etc) */
#game-controls {
  position: absolute;
  right: 20px;
  bottom: 20px;
  display: flex;
  gap: 5px;
  background: transparent;
  box-shadow: none;
  border: none;
}

#game-controls button {
  background: var(--bp-bg);
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2em;
}

/* Outcome Overlay */
#outcome-overlay {
  background-color: rgba(26, 38, 52, 0.9);
  backdrop-filter: blur(4px);
  border: 4px double var(--bp-ink);
  margin: 40px;
  width: auto;
  height: auto;
  inset: 0;
  box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

#outcome-message {
  font-family: var(--font-hand);
  font-size: 2em;
  transform: rotate(-2deg);
  color: var(--bp-accent);
  text-shadow: 2px 2px 0px #000;
}

