/* At My Gate – app styles */

/* Header / tab-bar */
.atg-header {
  background: #16a34a;
}
.atg-header h1.title {
  color: white;
  font-weight: bold;
  font-size: 1.1em;
  letter-spacing: 0.3px;
}

/* Side menu */
.left-off-canvas-menu {
  background: #1a2e1a;
}
.off-canvas-list li a {
  color: #d1fae5;
  border-bottom: 1px solid #2d4a2d;
}
.off-canvas-list li a:hover {
  background: #16a34a;
  color: white;
}
.off-canvas-list label {
  background: #14532d;
  color: #86efac;
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Application view */
#applicationView {
  background: #f3f4f6;
}

/* Shared form inputs */
input[type="text"],
input[type="tel"],
input[type="number"],
input[type="datetime-local"],
select,
textarea {
  border-radius: 8px;
  border: 1px solid #d1d5db;
  padding: 8px;
  width: 100%;
  box-sizing: border-box;
  font-size: 0.95em;
  background: white;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #16a34a;
  box-shadow: 0 0 0 2px #bbf7d0;
}

/* Primary button */
.atg-btn {
  background: #16a34a;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  cursor: pointer;
  font-size: 0.95em;
  font-weight: bold;
}
.atg-btn:hover {
  background: #15803d;
}
.atg-btn-sm {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 0.85em;
}
.atg-btn-danger {
  background: #fee2e2;
  color: #dc2626;
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 0.8em;
}

/* Member sign-in gate */
.atg-auth-loading,
.atg-auth-gate {
  min-height: calc(100vh - 45px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  box-sizing: border-box;
}
.atg-auth-loading {
  color: #6b7280;
}
.atg-auth-panel {
  width: min(420px, 100%);
  background: white;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(17,24,39,0.14);
  padding: 18px;
}
.atg-auth-panel h3 {
  color: #14532d;
  font-size: 1.1em;
  margin: 0 0 14px;
}
.atg-auth-panel label {
  color: #374151;
  display: block;
  font-size: 0.86em;
  font-weight: bold;
  margin: 9px 0 4px;
}
.atg-auth-submit {
  width: 100%;
  margin-top: 14px;
}
.atg-auth-status {
  min-height: 20px;
  color: #6b7280;
  font-size: 0.85em;
  margin-top: 10px;
}
.atg-auth-status.error {
  color: #dc2626;
}
.atg-auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-top: 12px;
}
.atg-auth-links a {
  color: #15803d;
  font-size: 0.9em;
  font-weight: bold;
}

/* Account */
.atg-account-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.atg-account-avatar {
  width: 64px;
  height: 64px;
  background: #dcfce7;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2em;
  flex: 0 0 auto;
}
.atg-account-name {
  color: #1f2937;
  font-size: 1.08em;
  font-weight: bold;
}
.atg-account-alias {
  color: #6b7280;
  font-size: 0.88em;
}
.atg-account-details {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 12px;
  margin: 0 0 18px;
}
.atg-account-details dt {
  color: #6b7280;
  font-size: 0.85em;
  font-weight: bold;
}
.atg-account-details dd {
  color: #1f2937;
  margin: 0;
  overflow-wrap: anywhere;
}
.atg-account-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* Listing card */
.atg-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  padding: 14px;
  margin-bottom: 10px;
}

/* Full-screen map view */
html,
body {
  height: 100%;
}
.off-canvas-wrap,
.inner-wrap {
  min-height: 100vh;
}
.inner-wrap {
  height: 100vh;
}
.left-off-canvas-menu {
  min-height: 100vh;
  z-index: 1200;
}
.atg-header {
  height: 45px;
}
.main-section {
  height: calc(100vh - 45px);
  overflow: hidden;
}
#applicationView {
  height: calc(100vh - 45px) !important;
  overflow: auto !important;
}
.atg-map-view {
  position: relative;
  height: 100%;
  min-height: calc(100vh - 45px);
  overflow: hidden;
  background: #e5e7eb;
}
.atg-map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #e5e7eb;
  z-index: 1;
}
.atg-map-toolbar {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 700;
  display: flex;
  gap: 8px;
  align-items: center;
}
.atg-map-tool-button,
.atg-search-action,
.atg-search-close {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  line-height: 1;
  white-space: nowrap;
}
.atg-map-tool-button {
  min-height: 38px;
  padding: 0 14px;
  background: white;
  color: #14532d;
  box-shadow: 0 2px 10px rgba(17,24,39,0.18);
}
.atg-map-tool-button.primary,
.atg-search-action {
  background: #16a34a;
  color: white;
}
.atg-map-tool-button:hover,
.atg-search-action:hover {
  background: #15803d;
  color: white;
}
.atg-map-search-backdrop {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 800;
  background: rgba(17,24,39,0.25);
}
.atg-map-search-panel {
  display: none;
  position: absolute;
  top: 60px;
  right: 12px;
  z-index: 900;
  width: min(360px, calc(100% - 24px));
  max-height: calc(100% - 84px);
  overflow-y: auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(17,24,39,0.28);
  padding: 14px;
}
.atg-map-search-backdrop.is-open,
.atg-map-search-panel.is-open {
  display: block;
}
.atg-search-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.atg-search-header h4,
.atg-near-you-header h4 {
  margin: 0;
  color: #14532d;
  font-size: 1em;
  font-weight: bold;
}
.atg-search-close {
  width: 32px;
  height: 32px;
  background: #f3f4f6;
  color: #374151;
  font-size: 1.2em;
}
.atg-search-field {
  margin-bottom: 10px;
}
.atg-search-field label {
  color: #374151;
  font-size: 0.82em;
  font-weight: bold;
  margin-bottom: 4px;
}
.atg-search-row {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 8px;
}
.atg-search-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}
.atg-search-action {
  min-height: 38px;
  padding: 0 14px;
}
.atg-search-action.secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}
.atg-search-action.secondary:hover {
  background: #e5e7eb;
  color: #1f2937;
}
.atg-near-you-overlay {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 14px;
  z-index: 650;
  max-height: 34vh;
  overflow: hidden;
  background: rgba(255,255,255,0.95);
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(17,24,39,0.22);
  padding: 10px;
}
.atg-near-you-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
#map-search-status {
  color: #6b7280;
  font-size: 0.78em;
  text-align: right;
}
.atg-near-you-list {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  white-space: nowrap;
}
.atg-near-card {
  display: inline-flex;
  flex-direction: column;
  vertical-align: top;
  width: 158px;
  min-height: 112px;
  margin-right: 8px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: white;
  color: #1f2937;
  box-shadow: 0 1px 4px rgba(17,24,39,0.12);
  cursor: pointer;
  text-align: left;
  white-space: normal;
}
.atg-near-card:hover {
  border-color: #16a34a;
}
.atg-near-card-emoji {
  font-size: 1.45em;
  line-height: 1;
  margin-bottom: 6px;
}
.atg-near-card-title {
  max-height: 2.5em;
  overflow: hidden;
  color: #1f2937;
  font-size: 0.86em;
  font-weight: bold;
  line-height: 1.2;
}
.atg-near-card-meta,
.atg-near-card-location,
.atg-near-card-price,
.atg-near-empty {
  font-size: 0.78em;
  line-height: 1.25;
}
.atg-near-card-meta {
  color: #6b7280;
  margin-top: 5px;
}
.atg-near-card-location {
  color: #9ca3af;
  margin-top: 3px;
}
.atg-near-card-price {
  color: #16a34a;
  margin-top: 5px;
  font-weight: bold;
}
.atg-near-empty {
  color: #6b7280;
  margin: 0;
  white-space: normal;
}
.atg-map-view .leaflet-bottom {
  bottom: 150px;
}
@media (max-width: 640px) {
  .atg-map-toolbar {
    top: 8px;
    right: 8px;
  }
  .atg-map-tool-button {
    min-height: 36px;
    padding: 0 11px;
    font-size: 0.85em;
  }
  .atg-map-search-panel {
    top: 52px;
    right: 8px;
    left: 8px;
    width: auto;
  }
  .atg-near-you-overlay {
    left: 8px;
    right: 8px;
    bottom: 10px;
    max-height: 38vh;
    padding: 9px;
  }
  .atg-near-card {
    width: 148px;
  }
  .atg-search-row {
    grid-template-columns: 1fr 88px;
  }
  .atg-account-details {
    grid-template-columns: 1fr;
    gap: 2px 0;
  }
}
