/* ── Theme Variables & Reset ── */
:root {
  --gold:        #F5A800;
  --gold-dark:   #d4900a;
  --gold-light:  #fff3d6;
  --white:       #ffffff;
  --off-white:   #f7f7f7;
  --grey-light:  #e8e8e8;
  --grey:        #aaaaaa;
  --grey-mid:    #888888;
  --grey-dark:   #555555;
  --text:        #333333;
  --text-muted:  #777777;
  --border:      #dddddd;
}

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

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--off-white);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Page specific body configuration for Map Locator */
body.map-locator {
  height: 100vh;
  overflow: hidden;
}

/* ── Header ── */
header {
  background: var(--white);
  color: var(--text);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  z-index: 10;
}
header img { height: 38px; }
header h1 { font-size: 18px; font-weight: 700; letter-spacing: .5px; color: var(--text); }
header h1 span { color: var(--gold); }

/* ── Common Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--gold); color: var(--white); }
.btn-primary:hover { background: var(--gold-dark); }
.btn-secondary { background: var(--grey-light); color: var(--grey-dark); border: 1px solid var(--border); }
.btn-secondary:hover { background: #dcdcdc; }
.btn-danger { background: #e53935; color: var(--white); }
.btn-danger:hover { background: #d32f2f; }
.btn:disabled { background: var(--grey); cursor: not-allowed; transform: none; }

/* ── Brand Badges ── */
.brand-rrl   { background: #fdecea; color: #d32f2f; }
.brand-trent { background: #e8f0fb; color: #1a73e8; }
.brand-rt    { background: #e8f0fb; color: #2563a8; }
.brand-gap   { background: #fce8f0; color: #a0275a; }
.brand-az    { background: #f3eafa; color: #7b2fa0; }
.brand-you   { background: #e8f5ea; color: #2a7a3a; }
.brand-rt3   { background: var(--gold-light); color: var(--gold-dark); }
.brand-def   { background: var(--grey-light); color: var(--grey-dark); }

/* ── Spinner animation ── */
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid var(--grey-light); border-top-color: var(--gold);
  border-radius: 50%; animation: spin .7s linear infinite;
  vertical-align: middle; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ─────────────────────────────────────────────────────────────────────────────
   MAP LOCATOR LAYOUT (index.php)
   ───────────────────────────────────────────────────────────────────────────── */
.app-body { display: flex; flex: 1; overflow: hidden; }

.sidebar {
  width: 360px;
  min-width: 300px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  box-shadow: 2px 0 8px rgba(0,0,0,.06);
  z-index: 5;
}

.search-panel {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--off-white);
}
.search-panel h2 { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; text-transform: uppercase; letter-spacing: .8px; font-weight: 600; }

.input-group { margin-bottom: 10px; }
.input-group label { display: block; font-size: 11px; color: var(--grey-mid); margin-bottom: 5px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.input-group input, .input-group select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  background: var(--white);
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.input-group input::placeholder { color: var(--grey); }
.input-group input:focus, .input-group select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245,168,0,.15);
}

.btn-row { display: flex; gap: 8px; margin-top: 4px; }
.btn-row .btn { flex: 1; padding: 10px; }

#status-msg {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 10px;
  min-height: 16px;
}
#status-msg.error   { color: #c0392b; }
#status-msg.success { color: #d4900a; font-weight: 600; }

.store-list-header {
  padding: 10px 16px;
  font-size: 11px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--grey-light);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
}

#store-list { flex: 1; overflow-y: auto; }
#store-list::-webkit-scrollbar { width: 4px; }
#store-list::-webkit-scrollbar-track { background: var(--off-white); }
#store-list::-webkit-scrollbar-thumb { background: var(--grey); border-radius: 2px; }

.store-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--grey-light);
  cursor: pointer;
  transition: background .15s;
}
.store-item:hover { background: var(--gold-light); }
.store-item.active { background: var(--gold-light); border-left: 3px solid var(--gold); }

.store-item .brand-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.store-item .store-name { font-size: 14px; font-weight: 600; color: var(--text); }
.store-item .store-addr { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }
.store-item .store-dist { font-size: 11px; color: var(--gold-dark); font-weight: 700; margin-top: 5px; }

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--grey);
  font-size: 14px;
}
.empty-state .icon { font-size: 40px; margin-bottom: 10px; }

#map { flex: 1; height: 100%; }

/* Info Window inside map */
.iw-wrap { font-family: 'Segoe UI', sans-serif; max-width: 260px; }
.iw-brand {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; padding: 3px 8px; border-radius: 10px;
  display: inline-block; margin-bottom: 6px;
}
.iw-name { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.iw-addr { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin-bottom: 8px; }
.iw-dist { font-size: 12px; color: var(--gold-dark); font-weight: 700; margin-bottom: 10px; }
.iw-nav {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--gold); color: var(--white);
  padding: 7px 14px; border-radius: 6px;
  text-decoration: none; font-size: 13px; font-weight: 700;
  transition: background .2s;
}
.iw-nav:hover { background: var(--gold-dark); }

@media (max-width: 640px) {
  .app-body { flex-direction: column; }
  .sidebar { width: 100%; height: 45vh; min-width: unset; }
  #map { height: 55vh; }
}


/* ─────────────────────────────────────────────────────────────────────────────
   GEOCODE MANAGER LAYOUT (geocode.php)
   ───────────────────────────────────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.top-bar h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 4.5fr 7.5fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--white);
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,.04);
  padding: 24px;
  margin-bottom: 24px;
}
.card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
  border-bottom: 2px solid var(--grey-light);
  padding-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert {
  padding: 14px 18px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid transparent;
}
.alert-success {
  background-color: #e8f5ea;
  border-color: #c8e6c9;
  color: #2e7d32;
}
.alert-danger {
  background-color: #fdecea;
  border-color: #ffcdd2;
  color: #c62828;
}
.alert-warning {
  background-color: #fff8e1;
  border-color: #ffe082;
  color: #f57f17;
}

.upload-zone {
  border: 2px dashed var(--grey);
  border-radius: 8px;
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  display: block;
  margin-bottom: 18px;
  position: relative;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--gold);
  background: var(--gold-light);
}
.upload-zone .icon {
  font-size: 32px;
  margin-bottom: 10px;
  display: block;
}
.upload-zone p {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.upload-zone span {
  font-size: 12px;
  color: var(--grey-mid);
}
.filename-display {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-dark);
  display: none;
  word-break: break-all;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.checkbox-group input {
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 500px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.stat-card {
  padding: 14px 8px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid var(--border);
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,.05);
}
.stat-card.total { background: var(--off-white); border-color: var(--border); color: var(--text); }
.stat-card.geocoded { background: #e8f5ea; border-color: #c8e6c9; color: #2e7d32; }
.stat-card.failed { background: #fdecea; border-color: #ffcdd2; color: #c62828; }
.stat-card.pending { background: var(--gold-light); border-color: #ffe082; color: var(--gold-dark); }
.stat-card .num {
  font-size: 22px;
  font-weight: 700;
  display: block;
  line-height: 1.2;
}
.stat-card .label {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: .5px;
  margin-top: 6px;
}

.progress-container {
  margin-bottom: 24px;
  background: var(--off-white);
  padding: 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.progress-bar-wrapper {
  width: 100%;
  background: var(--grey-light);
  border-radius: 10px;
  height: 18px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.1);
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-dark));
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 10px;
}
.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-top: 8px;
  font-weight: 600;
  color: var(--text-muted);
}

.controls-row {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.log-container h4 {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 8px;
  font-weight: 700;
}
#log {
  background: #1e1e1e;
  color: #a9b7c6;
  font-family: 'Courier New', Courier, monospace;
  padding: 14px;
  height: 200px;
  overflow-y: auto;
  font-size: 12.5px;
  border-radius: 6px;
  border: 1px solid #2d2d2d;
  line-height: 1.6;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.2);
}
#log .err-line { color: #ff5252; }
#log .ok-line { color: #4caf50; }
#log .info-line { color: #2196f3; }

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.modal-overlay.show {
  opacity: 1;
}
.modal-box {
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--border);
  border-top: 5px solid var(--gold);
  box-shadow: 0 15px 35px rgba(0,0,0,0.18);
  padding: 28px;
  max-width: 440px;
  width: 90%;
  transform: scale(0.9) translateY(-15px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}
.modal-overlay.show .modal-box {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.modal-icon {
  font-size: 24px;
  line-height: 1;
}
.modal-box h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.modal-box p {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 26px;
}
.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ── Login Form Styles ── */
.login-wrapper {
  max-width: 400px;
  width: 90%;
  margin: 0 auto;
}
.login-input:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px rgba(245,168,0,.15) !important;
}


