/* ============================================
   DodgeThatPothole — Styles
   ============================================ */

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

:root {
  --orange: #FF5A1F;
  --yellow: #FFBE00;
  --dark: #1A1A1A;
  --gray: #2C2C2C;
  --light: #F5F0E8;
  --red: #E8192C;
  --green: #22c55e;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--dark);
  color: var(--light);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== HEADER ===== */
header {
  background: var(--dark);
  border-bottom: 3px solid var(--orange);
  padding: 0 20px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
  flex-shrink: 0;
}
.logo { font-family: 'Bebas Neue', sans-serif; font-size: 26px; letter-spacing: 2px; }
.logo span { color: var(--orange); }
.tagline { font-size: 11px; color: #888; letter-spacing: 1px; text-transform: uppercase; display: none; }
@media (min-width: 500px) { .tagline { display: block; } }

.report-btn {
  background: var(--orange);
  color: white;
  border: none;
  padding: 9px 18px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 17px;
  letter-spacing: 1.5px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}
.report-btn:hover { background: #e04810; }

/* ===== STATS BAR ===== */
.stats-bar {
  background: var(--gray);
  padding: 7px 20px;
  display: flex;
  gap: 24px;
  align-items: center;
  font-size: 12px;
  color: #aaa;
  flex-shrink: 0;
  border-bottom: 1px solid #333;
}
.stat { display: flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-red { background: var(--red); }
.dot-orange { background: var(--orange); }
.dot-yellow { background: var(--yellow); }
.region-tag { margin-left: auto; font-size: 11px; color: #555; }

/* ===== MAP ===== */
#map { flex: 1; width: 100%; }

/* ===== POPUP ===== */
.leaflet-popup-content-wrapper {
  background: var(--dark);
  border: 2px solid var(--orange);
  border-radius: 8px;
  color: var(--light);
  font-family: 'DM Sans', sans-serif;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.leaflet-popup-tip { background: var(--orange); }
.leaflet-popup-content { margin: 14px 16px; min-width: 200px; }

.popup-severity {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14px;
  letter-spacing: 2px;
  padding: 3px 10px;
  border-radius: 3px;
  display: inline-block;
  margin-bottom: 8px;
}
.sev-dangerous { background: var(--red); color: white; }
.sev-major { background: var(--orange); color: white; }
.sev-minor { background: var(--yellow); color: var(--dark); }

.popup-location { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.popup-note { font-size: 12px; color: #aaa; margin-bottom: 10px; }
.popup-photo {
  width: 100%; height: 110px; object-fit: cover;
  border-radius: 6px; margin-bottom: 10px; border: 1px solid #333;
}
.popup-meta {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid #333; padding-top: 10px;
}
.upvote-btn {
  background: #2C2C2C; border: 1px solid #444; color: var(--light);
  padding: 5px 12px; border-radius: 20px; font-size: 12px;
  cursor: pointer; transition: all 0.15s; font-family: 'DM Sans', sans-serif;
}
.upvote-btn:hover { background: var(--orange); border-color: var(--orange); }
.upvote-btn.voted { background: var(--orange); border-color: var(--orange); cursor: default; }
.popup-date { font-size: 11px; color: #666; }
.expires { font-size: 10px; color: #666; margin-top: 6px; }

/* ===== REPORT MODAL ===== */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.75); z-index: 9999;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--dark); border: 2px solid var(--orange);
  border-radius: 12px; padding: 24px; width: 90%; max-width: 400px;
  animation: slideUp 0.2s ease; max-height: 92vh; overflow-y: auto;
}
@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal h2 {
  font-family: 'Bebas Neue', sans-serif; font-size: 24px;
  letter-spacing: 2px; margin-bottom: 4px; color: var(--orange);
}
.modal-sub { font-size: 12px; color: #888; margin-bottom: 20px; }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 11px; text-transform: uppercase;
  letter-spacing: 1px; color: #888; margin-bottom: 6px;
}
.optional-tag { font-size: 10px; color: #555; margin-left: 4px; text-transform: none; letter-spacing: 0; }

/* PHOTO */
.photo-area {
  border: 2px dashed #444; border-radius: 8px; height: 150px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s; position: relative; overflow: hidden; background: #222;
}
.photo-area:hover { border-color: var(--orange); }
.photo-area.has-photo { border-style: solid; border-color: var(--orange); }
.photo-area input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.photo-placeholder { text-align: center; pointer-events: none; }
.photo-placeholder .icon { font-size: 32px; margin-bottom: 6px; }
.photo-placeholder .text { font-size: 13px; color: #888; }
.photo-placeholder .subtext { font-size: 11px; color: #555; margin-top: 3px; }
.photo-preview { width: 100%; height: 100%; object-fit: cover; display: none; }
.photo-preview.show { display: block; }
.photo-retake {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.7); color: white; border: 1px solid #666;
  border-radius: 4px; padding: 4px 10px; font-size: 11px; cursor: pointer;
  z-index: 2; display: none;
}
.photo-retake.show { display: block; }

/* SEVERITY */
.severity-options { display: flex; gap: 8px; }
.sev-radio {
  flex: 1; text-align: center; padding: 8px 4px;
  border: 2px solid #444; border-radius: 6px; cursor: pointer;
  font-size: 11px; font-weight: 700; transition: all 0.15s;
}
.sev-radio:hover { border-color: #888; }
.sev-radio.sel-minor { border-color: var(--yellow); background: rgba(255,190,0,0.1); color: var(--yellow); }
.sev-radio.sel-major { border-color: var(--orange); background: rgba(255,90,31,0.1); color: var(--orange); }
.sev-radio.sel-dangerous { border-color: var(--red); background: rgba(232,25,44,0.1); color: var(--red); }

/* NOTE */
.form-group textarea {
  width: 100%; background: #222; border: 1px solid #444; border-radius: 6px;
  color: var(--light); padding: 10px; font-family: 'DM Sans', sans-serif;
  font-size: 13px; resize: none; height: 60px;
}
.form-group textarea:focus { outline: none; border-color: var(--orange); }

/* GPS */
.gps-status {
  background: #222; border: 1px solid #333; border-radius: 6px;
  padding: 10px 12px; font-size: 12px; color: #888;
  display: flex; align-items: center; gap: 8px;
}
.gps-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--yellow);
  flex-shrink: 0; animation: pulse 1.5s infinite;
}
.gps-dot.ready { background: var(--green); animation: none; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }
.gps-hint { font-size: 11px; color: #555; margin-top: 5px; }
.gps-hint .adjust-link { color: var(--orange); cursor: pointer; }

/* ACTIONS */
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.btn-submit {
  flex: 1; background: var(--orange); color: white; border: none; padding: 12px;
  font-family: 'Bebas Neue', sans-serif; font-size: 18px; letter-spacing: 1.5px;
  border-radius: 6px; cursor: pointer; transition: background 0.15s;
}
.btn-submit:hover { background: #e04810; }
.btn-submit:disabled { background: #444; color: #888; cursor: not-allowed; }
.btn-cancel {
  background: transparent; color: #888; border: 1px solid #444;
  padding: 12px 16px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.btn-cancel:hover { border-color: #888; color: var(--light); }

/* ===== DRAG PIN MODAL ===== */
.drag-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.85); z-index: 19999; flex-direction: column;
}
.drag-modal-overlay.open { display: flex; }
.drag-header {
  background: var(--dark); border-bottom: 2px solid var(--orange);
  padding: 14px 20px; flex-shrink: 0;
}
.drag-header h3 {
  font-family: 'Bebas Neue', sans-serif; font-size: 20px;
  letter-spacing: 2px; color: var(--orange);
}
.drag-header p { font-size: 12px; color: #888; margin-top: 2px; }
#dragMap { flex: 1; }
.drag-footer {
  background: var(--dark); border-top: 2px solid #333;
  padding: 14px 20px; display: flex; gap: 10px; flex-shrink: 0;
}
.btn-confirm-pin {
  flex: 1; background: var(--orange); color: white; border: none; padding: 12px;
  font-family: 'Bebas Neue', sans-serif; font-size: 18px; letter-spacing: 1.5px;
  border-radius: 6px; cursor: pointer;
}
.btn-confirm-pin:hover { background: #e04810; }
.btn-cancel-pin {
  background: transparent; color: #888; border: 1px solid #444;
  padding: 12px 16px; border-radius: 6px; cursor: pointer; font-size: 13px;
}

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--orange); color: white; padding: 12px 24px;
  border-radius: 30px; font-weight: 700; font-size: 13px;
  z-index: 99999; transition: transform 0.3s ease; white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }
