/* Golf Course Finder — shared styles */

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  color: #1a1a1a;
  background: #f4f6f8;
}

a {
  color: #0066cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* -------------------------------------------------------------------------
   Header
   ------------------------------------------------------------------------- */
.site-header {
  background: #1a5c2e;
  color: #fff;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: relative;
  z-index: 1000;
}

.site-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.site-header a {
  color: #b8e0c8;
  font-size: 0.875rem;
}

.site-header a:hover {
  color: #fff;
}

/* -------------------------------------------------------------------------
   Map page — controls panel
   ------------------------------------------------------------------------- */
.controls {
  background: #fff;
  border-bottom: 1px solid #dde2e8;
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  z-index: 999;
  position: relative;
}

.controls .search-group {
  display: flex;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-width: 200px;
}

.controls input[type="text"] {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid #c4cdd5;
  border-radius: 6px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}

.controls input[type="text"]:focus {
  border-color: #1a5c2e;
}

.controls .radius-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-width: 200px;
}

.controls .radius-group label {
  font-size: 0.875rem;
  color: #555;
  white-space: nowrap;
}

.controls input[type="range"] {
  flex: 1;
  accent-color: #1a5c2e;
  cursor: pointer;
}

/* -------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.9rem;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: #1a5c2e;
  color: #fff;
}

.btn-primary:hover {
  background: #134820;
}

.btn-secondary {
  background: #e8f0eb;
  color: #1a5c2e;
}

.btn-secondary:hover {
  background: #d0e4d8;
}

.btn-success {
  background: #2e7d32;
  color: #fff;
}

.btn-success:hover {
  background: #1b5e20;
}

.btn-danger {
  background: #c62828;
  color: #fff;
}

.btn-danger:hover {
  background: #8b0000;
}

.btn-warning {
  background: #f57c00;
  color: #fff;
}

.btn-warning:hover {
  background: #e65100;
}

.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}

/* -------------------------------------------------------------------------
   Results bar
   ------------------------------------------------------------------------- */
.results-bar {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #dde2e8;
  border-radius: 20px;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  color: #444;
  z-index: 500;
  pointer-events: none;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  white-space: nowrap;
}

/* -------------------------------------------------------------------------
   Map container
   ------------------------------------------------------------------------- */
#map-wrapper {
  position: relative;
}

#map {
  width: 100%;
}

/* -------------------------------------------------------------------------
   Admin page
   ------------------------------------------------------------------------- */
.admin-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.admin-container h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.stats-bar {
  display: flex;
  gap: 1.5rem;
  margin: 0.75rem 0 1.5rem;
  flex-wrap: wrap;
}

.stat-item {
  background: #fff;
  border: 1px solid #dde2e8;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.stat-item strong {
  font-size: 1.2rem;
  display: block;
  color: #1a5c2e;
}

/* Table */
.table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #dde2e8;
  background: #fff;
  margin-bottom: 2rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  background: #f0f4f1;
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #dde2e8;
  white-space: nowrap;
}

tbody tr:nth-child(even) {
  background: #fafcfb;
}

tbody tr:hover {
  background: #f0f4f1;
}

tbody td {
  padding: 0.5rem 0.75rem;
  vertical-align: middle;
  border-bottom: 1px solid #eef0f2;
}

.verified-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.verified-badge.yes {
  background: #e6f4ea;
  color: #2e7d32;
}

.verified-badge.no {
  background: #fce8e8;
  color: #c62828;
}

.action-group {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

/* Inline edit row */
.edit-form-row td {
  background: #f5f9ff;
  padding: 0.75rem;
}

.edit-form-row td input,
.edit-form-row td select {
  padding: 0.35rem 0.5rem;
  border: 1px solid #c4cdd5;
  border-radius: 4px;
  font-size: 0.85rem;
  width: 100%;
}

/* Add course form */
.add-course-section {
  background: #fff;
  border: 1px solid #dde2e8;
  border-radius: 8px;
  padding: 1.25rem;
}

.add-course-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #1a5c2e;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.45rem 0.6rem;
  border: 1px solid #c4cdd5;
  border-radius: 6px;
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #1a5c2e;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
}

/* -------------------------------------------------------------------------
   Responsive — mobile first
   ------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .controls {
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .controls .search-group,
  .controls .radius-group {
    min-width: 100%;
    flex: 1 1 100%;
  }

  .admin-container {
    padding: 1rem 0.5rem;
  }

  .stats-bar {
    gap: 0.75rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .action-group {
    flex-direction: column;
  }
}
