/* public/css/style.css */
:root {
  --bg: #0f1420;
  --panel: #171d2c;
  --border: #2a3245;
  --text: #e7ecf5;
  --muted: #93a0b8;
  --accent: #4da3ff;
  --accent-2: #21c98f;
  --danger: #ff5a6a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}

.topbar h1 { font-size: 1.2rem; margin: 0; }

.topbar-right { display: flex; align-items: center; gap: 18px; }

.utc-clock {
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  color: var(--muted);
  background: #0e131f;
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.admin-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}
.admin-link:hover { text-decoration: underline; }

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  padding: 20px;
  max-width: 1800px;
  margin: 0 auto;
}

.admin-layout { grid-template-columns: 1fr; max-width: 1100px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.wide-panel { width: 100%; }

h2 { margin-top: 0; font-size: 1.05rem; }

form { display: flex; flex-direction: column; gap: 6px; }

label { font-size: 0.85rem; color: var(--muted); margin-top: 8px; }

input, select {
  background: #0e131f;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px;
  border-radius: 6px;
  font-size: 0.95rem;
}

input:focus, select:focus { outline: 2px solid var(--accent); }

button {
  margin-top: 16px;
  padding: 10px 14px;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: #06121f;
  font-weight: 600;
  cursor: pointer;
}
button:hover { filter: brightness(1.1); }
button.secondary { background: transparent; border: 1px solid var(--border); color: var(--text); margin-top: 0; }
button.danger-btn { background: var(--danger); color: #200; }

.hint { color: var(--muted); font-size: 0.8rem; margin: 6px 0 0; }

.message { min-height: 1.2em; font-size: 0.85rem; }
.message.error { color: var(--danger); }
.message.success { color: var(--accent-2); }

.map-panel {
  position: relative;
  min-height: 640px;
  display: flex;
  flex-direction: column;
}

/* SVG is inline by default, leaving a few px of baseline gap below it that
   can look like a stray line against the following text. display:block
   removes that gap entirely. */
/* v4.1: lightened the ocean/base background and land fill so the day side
   of the map reads noticeably brighter than the night overlay - previously
   both were close in tone (dark navy vs dark navy + translucent black),
   which made day/night hard to tell apart. */
svg#map {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 640px;
  background: #212c46;
  border-radius: 8px;
}

.map-hint {
  margin-top: 14px;
  padding-top: 0;
  border: none;
}

.country-shape { fill: #48587c; stroke: #647096; stroke-width: 0.5; }

.night-overlay {
  fill: #00040c;
  fill-opacity: 0.62;
  pointer-events: none;
}

.dot {
  fill: var(--accent-2);
  stroke: #06251d;
  stroke-width: 0.6;
  cursor: pointer;
  transition: fill 0.15s ease;
}
.dot:hover { fill: var(--accent); }

/* Only the .hidden state hides the tooltip - no visibility/opacity on the
   base rule, otherwise removing .hidden never actually reveals it. */
.tooltip {
  position: absolute;
  background: #06090f;
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  pointer-events: none;
  z-index: 10;
  max-width: 240px;
}
.tooltip.hidden { display: none; }
.tooltip a { color: var(--accent); }

table { width: 100%; border-collapse: collapse; margin-top: 12px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
th { color: var(--muted); font-weight: 600; }

.admin-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.header-actions { display: flex; gap: 10px; }

.row-actions { display: flex; gap: 8px; }

.edit-row select, .edit-row input { padding: 6px; font-size: 0.8rem; }

.hidden { display: none !important; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .map-panel { min-height: 420px; }
  svg#map { min-height: 420px; }
}
