/* Styles for maps.html (FMB / Village Maps / Adangal).
   Note: the global .btn rule in style.css adds a peach :before bubble and
   27px left-margin to every Bootstrap button on the site. We avoid the .btn
   class on interactive elements here and use scoped classes instead. */

/* ---------- Top filter bar -------------------------------------------- */
.maps-filter-bar {
  background: #ffffff;
  border: 1px solid #eef1f5;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  padding: 18px 20px;
  margin-bottom: 24px;
}
.maps-filter-bar .filter-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #455a64;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ---------- Searchable dropdown -------------------------------------- */
.sdd { position: relative; width: 100%; }
.sdd-control {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  background: #fff;
  border: 1px solid #cfd8dc;
  border-radius: 8px;
  cursor: pointer;
  margin: 0 !important; /* defend against global .btn margin if it leaks */
  text-align: left;
  line-height: 1.4;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.sdd-control:hover { border-color: #90a4ae; }
.sdd.is-open .sdd-control,
.sdd-control:focus {
  outline: none;
  border-color: #1565c0;
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.12);
}
.sdd.is-disabled .sdd-control {
  background: #f5f7fa;
  color: #90a4ae;
  cursor: not-allowed;
}
.sdd-control::before,
.sdd-control::after { content: none !important; } /* neutralize global .btn pseudo */

.sdd-value {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sdd-caret {
  font-size: 11px;
  color: #607d8b;
  transition: transform .2s ease;
}
.sdd.is-open .sdd-caret { transform: rotate(180deg); }

.sdd-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  background: #fff;
  border: 1px solid #e5e9ef;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}
.sdd-search-wrap {
  position: relative;
  padding: 8px;
  border-bottom: 1px solid #eef1f5;
}
.sdd-search-wrap i {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #90a4ae;
  font-size: 12px;
}
.sdd-search {
  width: 100%;
  padding: 7px 10px 7px 30px;
  font-size: 13px;
  border: 1px solid #e5e9ef;
  border-radius: 6px;
  outline: none;
}
.sdd-search:focus { border-color: #1565c0; }

.sdd-options {
  list-style: none;
  padding: 4px 0;
  margin: 0;
  max-height: 240px;
  overflow-y: auto;
}
.sdd-options li {
  padding: 8px 14px;
  font-size: 13.5px;
  color: #1f2937;
  cursor: pointer;
  transition: background .1s ease;
}
.sdd-options li:hover { background: #f5f7fa; }
.sdd-options li.is-selected { background: #e3f2fd; color: #0d47a1; font-weight: 600; }
.sdd-options li.sdd-opt-all { color: #1565c0; font-weight: 600; border-bottom: 1px dashed #eef1f5; }
.sdd-options li.sdd-empty {
  color: #90a4ae;
  font-style: italic;
  text-align: center;
  cursor: default;
}
.sdd-options li.sdd-empty:hover { background: transparent; }

/* ---------- Get / Reset buttons (custom — NOT .btn) ----------------- */
.maps-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  margin: 0 !important;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.3px;
  border-radius: 8px;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s ease, box-shadow .15s ease, transform .05s ease;
  position: relative;
  z-index: 1;
}
.maps-action-btn::before,
.maps-action-btn::after { content: none !important; }
.maps-action-btn:active { transform: translateY(1px); }

.maps-get-btn {
  background: linear-gradient(135deg, #1565c0 0%, #1e88e5 100%);
  color: #fff;
  border-color: #1565c0;
  box-shadow: 0 1px 3px rgba(21, 101, 192, 0.25);
}
.maps-get-btn:hover, .maps-get-btn:focus {
  background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%);
  box-shadow: 0 3px 10px rgba(21, 101, 192, 0.4);
  color: #fff;
  outline: none;
}

.maps-reset-btn {
  background: #fff;
  color: #455a64;
  border-color: #cfd8dc;
}
.maps-reset-btn:hover, .maps-reset-btn:focus {
  background: #eceff1;
  color: #263238;
  outline: none;
}

/* ---------- Tabs (centered, matches lrs page style) ----------------- */
.maps-tabs {
  border-bottom: 2px solid #e5e9ef;
  gap: 4px;
}
.maps-tabs .nav-item { margin-bottom: -2px; }
.maps-tabs .nav-link {
  color: #5f6c7b;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .2px;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 14px 28px;
  background: transparent;
  border-radius: 8px 8px 0 0;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}
.maps-tabs .nav-link:hover {
  color: #1565c0;
  background: rgba(21, 101, 192, 0.05);
}
.maps-tabs .nav-link.active {
  color: #1565c0;
  border-bottom-color: #1565c0;
  background: rgba(21, 101, 192, 0.06);
}
.maps-tabs .nav-link .maps-count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #1565c0;
  background: #e3f2fd;
  border-radius: 999px;
}
.maps-tabs .nav-link.active .maps-count { background: #1565c0; color: #fff; }

/* ---------- Search bar (shared across all tabs) --------------------- */
.maps-search-bar .input-group-text {
  background: #f5f7fa;
  color: #455a64;
  border-right: none;
}
.maps-search-bar .form-control { border-left: none; }
.maps-search-bar .form-control:focus {
  box-shadow: none;
  border-color: #ced4da;
}

/* ---------- Selected village header ---------------------------------- */
.selected-village-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #1565c0 0%, #1e88e5 100%);
  color: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(21, 101, 192, 0.20);
}
.selected-village-header.is-empty {
  background: #fff8e1;
  color: #5d4037;
  border: 1px dashed #ffd54f;
  box-shadow: none;
}
.selected-village-header .sv-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.selected-village-header.is-empty .sv-icon {
  background: #fff3cd;
  color: #8d6e63;
}
.selected-village-header .sv-info { flex: 1; min-width: 0; }
.selected-village-header .sv-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 2px;
}
.selected-village-header .sv-name {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}
.selected-village-header .sv-breadcrumb {
  font-size: 13px;
  opacity: 0.9;
  margin-top: 2px;
}

/* ---------- Record card grid (one card per record) -------------------- */
/* Responsive grid: cards auto-fill the row, never narrower than 360px,
   stretch to share remaining width equally. */
.maps-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
  margin-top: 12px;
}

/* Single-row card: [icon] [content] [view-icon-button] */
.map-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid #e3e8ef;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04),
              0 4px 12px rgba(15, 23, 42, 0.05);
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.map-card:hover {
  border-color: #c7d0db;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06),
              0 10px 24px rgba(15, 23, 42, 0.09);
  transform: translateY(-2px);
}

.map-card-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.map-card-icon.type-fmb                { background: #fff3e0; color: #ef6c00; }
.map-card-icon.type-village_map        { background: #e8f5e9; color: #2e7d32; }
.map-card-icon.type-adangal            { background: #ede7f6; color: #6a1b9a; }
.map-card-icon.type-master_plan_layout { background: #e0f7fa; color: #00838f; }
.map-card-icon.type-ilup               { background: #fce4ec; color: #c2185b; }

.map-card-content { flex: 1; min-width: 0; }
.map-card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.35;
  word-break: break-word;
}
.map-card-meta {
  font-size: 12px;
  color: #78909c;
  margin-top: 5px;
  line-height: 1.6;
  word-break: break-word;
}
.map-card-meta strong { color: #455a64; font-weight: 600; }
.map-card-meta .meta-approval,
.map-card-meta .meta-fileid {
  font-family: 'Courier New', monospace;
  font-size: 11.5px;
  background: #f5f7fa;
  padding: 1px 6px;
  border-radius: 4px;
  color: #455a64;
}
.map-card-meta .meta-size {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  background: #eceff1;
  color: #455a64;
  border-radius: 999px;
}

/* Icon-only View button — circular, sits at the right edge of the card.
   Custom class (NOT .btn) to bypass the global :before bubble. */
.map-view-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #1565c0;
  border: 1px solid #1565c0;
  border-radius: 50%;
  text-decoration: none;
  cursor: pointer;
  margin: 0 !important;
  padding: 0;
  box-shadow: 0 1px 3px rgba(21, 101, 192, 0.25);
  transition: background .15s ease, transform .12s ease, box-shadow .15s ease;
}
.map-view-btn:hover, .map-view-btn:focus {
  background: #0d47a1;
  color: #fff;
  text-decoration: none;
  transform: scale(1.05);
  box-shadow: 0 3px 8px rgba(21, 101, 192, 0.4);
  outline: none;
}
.map-view-btn:active { transform: scale(0.95); }
.map-view-btn i { font-size: 14px; }
.map-view-btn::before, .map-view-btn::after { content: none !important; }

/* ---------- Empty state --------------------------------------------- */
/* Empty state spans every column of the cards grid so it can center
   inside the full tab width (not just the first 360-px column). */
/* ---------- Pager (per tab, below the cards grid) -------------------- */
.maps-pager {
  margin-top: 18px;
}
.maps-pager:empty { display: none; }
.pager-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #fafbfc;
  border: 1px solid #eef1f5;
  border-radius: 10px;
  font-size: 13px;
  color: #455a64;
}
.pager-count strong { color: #1565c0; font-weight: 700; }
.pager-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pager-info strong { color: #1f2937; font-weight: 700; }
.pager-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
  color: #455a64;
  background: #fff;
  border: 1px solid #cfd8dc;
  cursor: pointer;
  user-select: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.pager-chevron:hover { background: #eceff1; color: #1565c0; border-color: #b0bec5; }
.pager-chevron:focus-visible { outline: 2px solid #1565c0; outline-offset: 2px; }
.pager-chevron.is-disabled { opacity: 0.4; pointer-events: none; }
.pager-size { display: inline-flex; align-items: center; gap: 8px; }
.pager-size label { margin: 0; color: #607d8b; font-size: 12px; font-weight: 600; }
.pager-size-select {
  padding: 4px 8px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid #cfd8dc;
  background: #fff;
  cursor: pointer;
}
.pager-size-select:focus { outline: 2px solid #1565c0; outline-offset: 2px; }

@media (max-width: 575.98px) {
  .pager-row { justify-content: center; }
  .pager-count, .pager-controls, .pager-size { flex: 1 1 100%; justify-content: center; }
}

.maps-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 20px;
  color: #90a4ae;
}
.maps-empty > i {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}
.maps-empty p {
  font-size: 15px;
  margin: 0 0 18px;
}

.maps-empty-suggest {
  margin-top: 10px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.maps-empty-suggest .suggest-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #607d8b;
  margin-bottom: 10px;
  text-align: center;
}
.maps-empty-suggest .suggest-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  max-width: 900px;
  width: 100%;
}
.suggest-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 6px 7px 14px;     /* tighter right side: count badge has its own padding */
  font-size: 13px;
  font-weight: 600;
  color: #0d47a1;
  background: #e3f2fd;
  border: 1px solid #bbdefb;
  border-radius: 999px;
  cursor: pointer;
  margin: 0 !important;
  transition: background .15s ease, border-color .15s ease, transform .08s ease;
}
.suggest-chip:hover, .suggest-chip:focus {
  background: #bbdefb;
  border-color: #90caf9;
  outline: none;
}
.suggest-chip:active { transform: translateY(1px); }
.suggest-chip i { font-size: 11px; opacity: 0.8; }
.suggest-chip::before, .suggest-chip::after { content: none !important; }

.suggest-chip .chip-count {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  background: rgba(13, 71, 161, 0.12);
  color: #0d47a1;
  border-radius: 999px;
  line-height: 1.4;
}
.suggest-chip:hover .chip-count,
.suggest-chip:focus .chip-count {
  background: rgba(13, 71, 161, 0.18);
}

.maps-empty-suggest .suggest-hint {
  margin-top: 14px;
  font-size: 12px;
  color: #90a4ae;
  font-style: italic;
  max-width: 560px;
  text-align: center;
}

/* ---------- Responsive ---------------------------------------------- */
@media (max-width: 575.98px) {
  .maps-list { grid-template-columns: 1fr; }
  .maps-tabs .nav-link { padding: 12px 16px; font-size: 14px; }
}
