/* ===== Fuel Depot Map — Aviation Glow (clean) ===== */

/* Palette & spacing */
:root {
  --bg: #0a0f1c;
  --surface: #0f1729;
  --card: #111b34;
  --line: rgba(255, 255, 255, 0.09);

  --text: #eaf1ff;
  --muted: #9fb0c8;

  /* Brand — all buttons blue */
  --primary: #1ea7ff;
  --primary-600: #118be0;
  --primary-700: #0d6fb6;

  --success: #28c76f;
  --danger: #ff5c73;

  --content: 1100px;
  --radius: 16px;

  --shadow-outer: 0 14px 36px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 0 0 3px rgba(30, 167, 255, 0.12);
}

/* Base */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, Segoe UI,
    Roboto, Arial, sans-serif;
  font-size: 16.5px;
  background: radial-gradient(
      900px 500px at 80% 8%,
      rgba(30, 167, 255, 0.1),
      transparent 60%
    ),
    radial-gradient(
      1100px 600px at 15% -10%,
      rgba(30, 167, 255, 0.1),
      transparent 60%
    ),
    linear-gradient(180deg, #090e1a 0%, #070c16 100%);
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  margin: 0 auto;
  max-width: var(--content);
  background: linear-gradient(
    180deg,
    rgba(17, 27, 52, 0.85),
    rgba(17, 27, 52, 0.65)
  );
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-outer);
  backdrop-filter: blur(6px);
  margin-top: 14px;
}
.app-header h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.3px;
  font-weight: 800;
  background: linear-gradient(90deg, var(--primary), #7fd3ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.totals {
  color: #d6e8ff;
  font-weight: 600;
  font-size: 14px;
}
.totals span {
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  margin: 0 0.15rem;
  background: linear-gradient(
    180deg,
    rgba(30, 167, 255, 0.18),
    rgba(30, 167, 255, 0.1)
  );
  border: 1px solid var(--line);
}

/* HERO */
.intro-section {
  max-width: var(--content);
  margin: 18px auto 8px;
  padding: 0 16px;
}
.card {
  background: radial-gradient(
      360px 200px at 12% -10%,
      rgba(30, 167, 255, 0.12),
      transparent 60%
    ),
    linear-gradient(180deg, rgba(18, 29, 54, 0.96), rgba(13, 22, 43, 0.94));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-outer), var(--shadow-glow);
  padding: 16px 18px 14px;
}
.hero {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.preheadline {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  font-size: 12px;
  letter-spacing: 0.5px;
  font-weight: 800;
  color: #001424;
  background: #aee2ff;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  width: fit-content;
}
.headline {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 900;
}
.subheadline {
  margin: 0.25rem 0 0;
  color: #cee3ff;
  max-width: 70ch;
  line-height: 1.55;
}

/* Layout: two columns (New Operation + Map) */
.layout.two-cols {
  max-width: var(--content);
  margin: 20px auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.map-wrap.card {
  height: 560px;
  padding: 12px;
}
#map {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-outer);
}

/* Form & controls */
.row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.row-flex {
  display: flex;
  gap: 8px;
  align-items: center;
}
.row-flex input {
  flex: 1;
}

input,
select,
button {
  font: inherit;
  border-radius: 12px;
  outline: none;
}
input[type="text"],
input[type="number"],
select {
  background: #0d1529;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.55rem 0.7rem;
  transition: box-shadow 0.2s, border-color 0.2s, background 0.2s;
}
input::placeholder {
  color: #7f8aa3;
}
input:focus,
select:focus {
  border-color: var(--primary-600);
  box-shadow: 0 0 0 3px rgba(30, 167, 255, 0.22);
  background: #0c1830;
}

/* Buttons — all blue */
button {
  cursor: pointer;
  border: none;
  transition: transform 0.06s ease, filter 0.2s ease, box-shadow 0.2s;
}
button:active {
  transform: translateY(1px);
}
button.primary,
button.secondary,
button.ghost,
button.danger {
  border: 1px solid transparent;
}
button.primary,
button.secondary {
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  color: #03111d;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(30, 167, 255, 0.25);
  padding: 0.6rem 0.9rem;
}
button.primary:hover,
button.secondary:hover {
  filter: brightness(1.06);
}
button.ghost {
  background: transparent;
  color: #d6e8ff;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  padding: 0.5rem 0.8rem;
}
button.danger {
  background: linear-gradient(
    180deg,
    rgba(255, 92, 115, 0.24),
    rgba(255, 92, 115, 0.18)
  );
  border: 1px solid rgba(255, 92, 115, 0.45);
  color: #ffe8ec;
  padding: 0.55rem 0.85rem;
}

/* Coords block */
.coords {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(0, 0, 0, 0)
  );
}
.coord-line {
  display: flex;
  gap: 8px;
  align-items: center;
}
.hint {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 8px;
}

/* History + Sites (below) */
.below-grid {
  max-width: var(--content);
  margin: 0 auto 26px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.history-list .log {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0c1530;
  margin-bottom: 8px;
}
.history-list .strong {
  font-weight: 800;
  color: #eaf1ff;
}
.history-list .meta {
  color: var(--muted);
  font-size: 12.5px;
}

/* Sites list */
.sites-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.sites-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.site-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0c1530;
}
.site-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.site-name {
  display: flex;
  gap: 6px;
  align-items: center;
}
.site-name input {
  flex: 1;
}
.site-meta {
  color: var(--muted);
  font-size: 12.5px;
}
.site-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.site-actions .mini {
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 10px;
}
.badge-low {
  background: #2b0d0d;
  color: #ffb4b4;
  border: 1px solid #4a1a1a;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 11px;
}

/* Leaflet popup contrast */
.leaflet-popup-content {
  color: var(--text);
}
.leaflet-popup-content .row {
  margin: 6px 0;
}
.leaflet-popup-content input.pop-qty {
  width: 90px;
  background: #0d1529;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 0.35rem 0.45rem;
}
.leaflet-popup-content .popup-actions button {
  background: linear-gradient(
    180deg,
    var(--primary),
    var(--primary-600)
  ) !important;
  color: #03111d !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}
.leaflet-popup-content .popup-actions .danger {
  background: linear-gradient(
    180deg,
    rgba(255, 92, 115, 0.28),
    rgba(255, 92, 115, 0.2)
  ) !important;
  color: #ffe9ed !important;
  border: 1px solid rgba(255, 92, 115, 0.5) !important;
}
.leaflet-control-layers {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
}

/* Footer */
.app-footer {
  margin: 24px 0 30px;
  padding: 0 16px;
}
.footer-inner {
  max-width: var(--content);
  margin: 0 auto;
  background: linear-gradient(
    180deg,
    rgba(18, 29, 54, 0.9),
    rgba(13, 22, 43, 0.9)
  );
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-outer);
  padding: 14px 18px;
  text-align: center;
}
#footer-text {
  margin: 0;
  color: #d9e7ff;
  font-size: 14.5px;
}
#footer-text a {
  color: var(--primary);
  font-weight: 700;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: linear-gradient(
    90deg,
    rgba(30, 167, 255, 0.22),
    rgba(30, 167, 255, 0.14)
  );
  color: #e7f7ff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 0.55rem 0.9rem;
  border-radius: 12px;
  box-shadow: var(--shadow-outer);
  z-index: 9999;
}

/* Responsive */
@media (max-width: 980px) {
  .layout.two-cols {
    grid-template-columns: 1fr;
  }
  .map-wrap.card {
    height: 420px;
  }
  .below-grid {
    grid-template-columns: 1fr;
  }
  .headline {
    font-size: 24px;
  }
}

/* ==== Popup: dark theme override ==== */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #101a32 !important;
  color: #eaf1ff !important;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6);
  border-radius: 14px;
}

.leaflet-popup-content {
  color: #eaf1ff !important;
  font-size: 14px;
  line-height: 1.45;
}

.leaflet-popup-content strong {
  color: #ffffff;
}

.leaflet-popup-content .popup-actions {
  margin-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
}

.leaflet-popup-content input.pop-qty {
  width: 90px;
  background: #0d1529;
  color: #eaf1ff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 0.35rem 0.45rem;
}

.leaflet-popup-content .popup-actions button {
  background: linear-gradient(
    180deg,
    var(--primary),
    var(--primary-600)
  ) !important;
  color: #03111d !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 10px;
  padding: 0.4rem 0.6rem;
  font-weight: 700;
}

.leaflet-popup-content .popup-actions .danger {
  background: linear-gradient(
    180deg,
    rgba(255, 92, 115, 0.28),
    rgba(255, 92, 115, 0.2)
  ) !important;
  color: #ffe9ed !important;
  border: 1px solid rgba(255, 92, 115, 0.5) !important;
}
