/* ==========================================================
   🌌 GLOBAL THEME VARIABLES
   Defines your base color palette and reusables for a dark sci-fi look
   ========================================================== */
:root {
  --bg: #0b0f14;
  --panel: #121822;
  --text: #e6eef8;
  --accent: #59c1ff;
  --muted: #8aa0b2;
}

/* ==========================================================
   🔧 BASE / RESET
   Normalize box sizing and apply global font and color
   ========================================================== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, Segoe UI, Roboto;
}

/* ==========================================================
   🧱 PAGE WRAPPER / CONTAINER
   Centers main content and limits width
   ========================================================== */
.wrap {
  max-width: 980px;
  margin: 24px auto;
  padding: 0 16px;
}

/* ==========================================================
   🧭 HEADER / NAVIGATION
   Shared top bar for all pages
   ========================================================== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

h1 {
  font-weight: 700;
  letter-spacing: 0.5px;
}

nav a {
  color: var(--accent);
  text-decoration: none;
  margin-left: 8px;
}

/* ==========================================================
   💰 IN-GAME HUD (Exchange screen)
   Shows day, zone, cash, cargo
   ========================================================== */
#hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  background: var(--panel);
  padding: 12px;
  border-radius: 10px;
  margin: 12px 0;
}

/* ==========================================================
   ⚠️ EVENT BANNER
   Used for Exchange random events / notifications
   ========================================================== */
.event {
  margin: 12px 0;
  padding: 10px;
  background: #101520;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  color: #bfe6ff;
}

/* ==========================================================
   📊 TABLES / GRID LAYOUT
   Used for markets, leaderboards, corp members, applications, etc.
   ========================================================== */
.grid {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border-radius: 10px;
  overflow: hidden;
}

.grid th,
.grid td {
  padding: 10px;
  border-bottom: 1px solid #1c2430;
}

.grid th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
}

/* ==========================================================
   🔘 BUTTONS
   Consistent styling for all buttons + transitions
   ========================================================== */
button {
  background: var(--accent);
  color: #001723;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

button:hover:not(:disabled) {
  background: #6cd1ff;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ==========================================================
   ⚙️ ACTION BUTTON GROUPS
   Aligns side-by-side buttons (e.g., “Travel” / “Refresh Market”)
   ========================================================== */
.actions {
  display: flex;
  gap: 10px;
  margin: 12px 0;
}

/* ==========================================================
   📜 LOG / ACTIVITY FEED
   Used for system messages or activity panels
   ========================================================== */
.log {
  background: #0f141c;
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--muted);
  max-height: 150px;
  overflow-y: auto;
  margin: 12px 0;
}

.log p {
  margin: 2px 0;
}

.log small { color: var(--accent); opacity: 0.8; }

/* ==========================================================
   🧭 TAB NAVIGATION
   Used for Leaderboards and Corporation Center
   ========================================================== */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.tabs button {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
}

.tabs button.active {
  background: var(--accent);
  color: #001723;
  font-weight: bold;
}

/* ==========================================================
   💬 CORPORATION CHAT
   Scrollable chat box + message input form
   ========================================================== */
.chat-box {
  background: var(--panel);
  height: 300px;
  overflow-y: auto;
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.chat-box div {
  margin-bottom: 4px;
}

#chat-form {
  display: flex;
  gap: 6px;
}

#chat-form input {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  border: none;
}

#chat-form button {
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  background: var(--accent);
  color: #001723;
}

/* ==========================================================
   📢 CORPORATION BULLETINS
   For creating + displaying corp announcements
   ========================================================== */
.bulletins textarea {
  width: 100%;
  min-height: 80px;
  margin-top: 6px;
  border-radius: 6px;
  padding: 6px;
}

.bulletin {
  background: var(--panel);
  padding: 10px;
  margin: 10px 0;
  border-radius: 8px;
}

.bulletin.pinned {
  border-left: 4px solid var(--accent);
}

footer {
  border-top: 1px solid #1a2230;
  padding-top: 8px;
  margin-top: 16px;
}


/* ==========================================================
   📢 CORPORATION Management
   For creating + joining corps
   ========================================================== */
#corp-name {
  padding: 8px;
  border-radius: 6px;
  border: none;
  margin-right: 6px;
}
.apply-btn {
  padding: 6px 10px;
  border-radius: 6px;
}

#corp-banner {
  transition: opacity 0.4s ease;
  font-weight: 500;
}

.role {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 13px;
}
.role-founder { background: #59c1ff33; color: #59c1ff; }
.role-officer { background: #9f59ff33; color: #c09aff; }
.role-member  { background: #8aa0b233; color: #8aa0b2; }
