/* ============================================
   LIONHEART ENERGY — SITE MAP PORTAL
   Global styles & layout

   Brand palette extracted from logo:
   - Navy/charcoal:  #2b3040 (bg), #1f2533 (deep), #3d4560 (light)
   - Gold:           #c5a55a (primary), #d6bc78 (hover/light), #b8943e (dark/pressed)
   - Gold pale:      #f3ebcf (tints), #faf6ec (very light bg)
   - White text on dark, warm grays for UI
   - Serif: Playfair Display (logo "LIONHEART ENERGY")
   - Sans: Inter (subtitles, body, UI)
   ============================================ */

:root {
  /* ── Core Brand ── */
  --lh-navy:       #2b3040;
  --lh-navy-deep:  #1f2533;
  --lh-navy-light: #3d4560;
  --lh-navy-hover: #343b52;
  --lh-gold:       #c5a55a;
  --lh-gold-hover: #d6bc78;
  --lh-gold-dark:  #b8943e;
  --lh-gold-pale:  #f3ebcf;
  --lh-gold-faint: #faf6ec;

  /* ── Neutrals ── */
  --lh-cream:      #faf8f2;
  --lh-white:      #ffffff;
  --lh-gray-50:    #fafaf8;
  --lh-gray-100:   #f4f3f0;
  --lh-gray-200:   #e5e3de;
  --lh-gray-300:   #cccac4;
  --lh-gray-400:   #9a968e;
  --lh-gray-500:   #77746c;
  --lh-gray-600:   #5a5850;
  --lh-gray-800:   #2c2b28;

  /* ── Semantic ── */
  --lh-red:        #d94444;
  --lh-green:      #2e8b57;
  --lh-blue:       #3b7dd8;

  /* ── Typography ── */
  --font-serif:    'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* ── Layout ── */
  --topbar-h:      56px;
  --toolbar-w:     280px;
  --panel-w:       284px;
  --radius:        8px;
  --radius-sm:     5px;

  /* ── Shadows ── */
  --shadow-sm:     0 1px 3px rgba(43,48,64,.06);
  --shadow-md:     0 4px 16px rgba(43,48,64,.10);
  --shadow-lg:     0 8px 32px rgba(43,48,64,.16);
  --shadow-gold:   0 0 0 3px rgba(197,165,90,.18);
}

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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--lh-gray-800);
  background: var(--lh-gray-100);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--lh-gold-pale);
  color: var(--lh-navy);
}

.hidden { display: none !important; }

/* ===========================
   BUTTONS
   =========================== */

.btn-gold {
  background: linear-gradient(180deg, var(--lh-gold) 0%, var(--lh-gold-dark) 100%);
  color: var(--lh-navy-deep);
  border: none;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  padding: 10px 24px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .2s ease;
  box-shadow: 0 1px 3px rgba(197,165,90,.25);
  text-shadow: 0 1px 0 rgba(255,255,255,.15);
  letter-spacing: .01em;
}
.btn-gold:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--lh-gold-hover) 0%, var(--lh-gold) 100%);
  box-shadow: 0 2px 8px rgba(197,165,90,.35);
  transform: translateY(-1px);
}
.btn-gold:active:not(:disabled) {
  transform: translateY(0) scale(.98);
  box-shadow: 0 1px 2px rgba(197,165,90,.2);
}
.btn-gold:disabled { opacity: .4; cursor: not-allowed; }

.btn-sm { padding: 6px 14px; font-size: 12px; }

.btn-outline {
  background: transparent;
  color: var(--lh-gray-600);
  border: 1.5px solid var(--lh-gray-300);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s ease;
}
.btn-outline:hover {
  background: var(--lh-gray-50);
  border-color: var(--lh-gray-400);
  color: var(--lh-gray-800);
}
.btn-danger {
  color: var(--lh-red);
  border-color: rgba(217,68,68,.25);
}
.btn-danger:hover {
  background: rgba(217,68,68,.05);
  border-color: var(--lh-red);
}

/* ===========================
   APP LAYOUT
   =========================== */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ===========================
   TOP BAR
   =========================== */
.topbar {
  height: var(--topbar-h);
  background: linear-gradient(180deg, var(--lh-navy) 0%, var(--lh-navy-deep) 100%);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  flex-shrink: 0;
  z-index: 100;
  border-bottom: 2.5px solid var(--lh-gold);
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.topbar-logo { width: 40px; height: 30px; object-fit: contain; filter: brightness(0) invert(1); }
.topbar-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--lh-gold);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.topbar-divider {
  color: var(--lh-navy-light);
  font-size: 18px;
  font-weight: 200;
  opacity: .5;
}
.topbar-page {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,.45);
  letter-spacing: .03em;
}

/* Address search */
.topbar-search {
  flex: 1;
  max-width: 440px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar-search input {
  flex: 1;
  height: 34px;
  background: rgba(255,255,255,.07);
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: var(--radius-sm);
  padding: 0 12px 0 36px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--lh-white);
  outline: none;
  transition: all .2s ease;
}
.topbar-search input::placeholder { color: rgba(255,255,255,.3); }
.topbar-search input:focus {
  border-color: var(--lh-gold);
  background: rgba(255,255,255,.1);
  box-shadow: var(--shadow-gold);
}
.search-icon {
  position: absolute;
  left: 11px;
  width: 16px;
  height: 16px;
  color: rgba(255,255,255,.3);
  pointer-events: none;
}
.topbar-search .btn-sm {
  background: var(--lh-gold);
  color: var(--lh-navy-deep);
  border: none;
  font-weight: 700;
  cursor: pointer;
  border-radius: var(--radius-sm);
  letter-spacing: .02em;
  transition: all .15s ease;
}
.topbar-search .btn-sm:hover {
  background: var(--lh-gold-hover);
}

/* Site info chips */
.topbar-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.info-chip {
  font-size: 11px;
  color: rgba(255,255,255,.45);
  background: rgba(255,255,255,.06);
  padding: 4px 12px;
  border-radius: 4px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,.05);
}

/* Google Places Autocomplete dropdown styling */
.pac-container {
  z-index: 10000 !important;
  border-radius: 8px !important;
  border: 1px solid var(--lh-gray-200) !important;
  box-shadow: var(--shadow-lg) !important;
  font-family: var(--font-sans) !important;
  margin-top: 4px;
}
.pac-item {
  padding: 8px 12px !important;
  font-size: 12px !important;
  cursor: pointer !important;
  border-top: 1px solid var(--lh-gray-100) !important;
}
.pac-item:hover {
  background: var(--lh-gold-faint) !important;
}
.pac-item-query {
  font-size: 12px !important;
  color: var(--lh-navy) !important;
  font-weight: 600 !important;
}
.pac-matched {
  color: var(--lh-gold-dark) !important;
  font-weight: 700 !important;
}
.pac-icon {
  display: none !important;
}

/* ===========================
   MAIN LAYOUT
   =========================== */
.main-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ===========================
   MAP
   =========================== */
.map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.map {
  width: 100%;
  height: 100%;
}

/* Measurement tooltip */
.measure-tooltip {
  position: fixed;
  background: var(--lh-navy-deep);
  color: var(--lh-gold);
  font-weight: 700;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  pointer-events: none;
  z-index: 500;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(197,165,90,.25);
  letter-spacing: .02em;
}

/* Active tool badge */
.active-tool-badge {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--lh-navy);
  color: var(--lh-gold);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 18px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  border: 1.5px solid rgba(197,165,90,.3);
  letter-spacing: .02em;
}
.active-tool-badge button {
  background: none;
  border: none;
  color: rgba(255,255,255,.4);
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
  transition: color .15s;
}
.active-tool-badge button:hover { color: var(--lh-white); }

/* Drawing edit controls bar */
.drawing-controls {
  position: absolute;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--lh-navy);
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  border: 1.5px solid rgba(197,165,90,.25);
}
.dc-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.75);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.dc-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.dc-btn:hover:not(:disabled) {
  background: rgba(255,255,255,.15);
  color: var(--lh-white);
}
.dc-btn:disabled {
  opacity: .3;
  cursor: not-allowed;
}
.dc-finish {
  color: var(--lh-gold);
  border-color: rgba(197,165,90,.3);
}
.dc-finish:hover:not(:disabled) {
  background: rgba(197,165,90,.2);
  color: var(--lh-gold-hover);
}
.dc-move.active {
  background: rgba(197,165,90,.25);
  color: var(--lh-gold);
  border-color: rgba(197,165,90,.4);
}
.dc-cancel {
  color: rgba(255,255,255,.5);
}
.dc-cancel:hover:not(:disabled) {
  color: var(--lh-red);
  background: rgba(217,68,68,.1);
  border-color: rgba(217,68,68,.25);
}
.dc-delete {
  color: rgba(255,255,255,.5);
}
.dc-delete:hover:not(:disabled) {
  color: #ff4444;
  background: rgba(255,68,68,.15);
  border-color: rgba(255,68,68,.3);
}
.dc-sep {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,.12);
  margin: 0 2px;
  flex-shrink: 0;
}

/* ===========================
   SCROLLBAR
   =========================== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--lh-gray-300);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--lh-gray-400); }

/* ===========================
   FOCUS RINGS
   =========================== */
*:focus-visible {
  outline: 2px solid var(--lh-gold);
  outline-offset: 2px;
}
input:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 2px solid var(--lh-gold);
  outline-offset: 1px;
}

/* ============================================
   EQUIPMENT CONFIG MODAL
   ============================================ */
.equip-config-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}
.equip-config-modal.hidden { display: none; }
.equip-config-content {
  background: var(--lh-navy);
  border: 1px solid var(--lh-navy-light);
  border-radius: 12px;
  width: 380px;
  max-width: 90vw;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  overflow: hidden;
}
.equip-config-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--lh-navy-light);
  color: #fff;
  font-size: 14px;
}
.equip-config-close {
  background: none;
  border: none;
  color: #8891a5;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
}
.equip-config-close:hover { color: #fff; }
.equip-config-body {
  padding: 16px 18px;
  color: #c8cdd8;
  font-size: 13px;
}
.equip-config-body label {
  display: block;
  margin-bottom: 12px;
}
.equip-config-body label span {
  display: block;
  margin-bottom: 4px;
  color: #8891a5;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.equip-config-body select,
.equip-config-body input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  background: var(--lh-navy-deep);
  border: 1px solid var(--lh-navy-light);
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
}
.equip-config-body .checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.equip-config-body .checkbox-row input[type="checkbox"] {
  accent-color: var(--lh-gold);
}
.equip-config-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--lh-navy-light);
}
.equip-config-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.equip-config-btn.cancel {
  background: var(--lh-navy-light);
  color: #c8cdd8;
}
.equip-config-btn.confirm {
  background: var(--lh-gold);
  color: var(--lh-navy-deep);
}
.equip-config-btn.confirm:hover {
  background: var(--lh-gold-hover, #d6bc78);
}
