/* ===== REPORT FORM OVERLAYS & CHIPS ===== */

/* === BASE STYLES (REQUIRED for modal to function on ALL screen sizes) === */
#report-form-overlay {
  position: fixed;
  inset: 0;
  z-index: 9600;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#report-form-modal {
  background: white;
  border-radius: 28px 28px 0 0;
  width: 100%;
  max-width: 640px;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.15);
  transform: translateY(20px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#report-form-overlay.is-open #report-form-modal {
  transform: translateY(0);
}

/* On tablet and desktop, show as centered dialog */
@media (min-width: 768px) {
  #report-form-overlay {
    align-items: center;
    padding: 24px;
  }
  #report-form-modal {
    border-radius: 24px;
    max-height: 88dvh;
    transform: scale(0.96) translateY(16px);
  }
  #report-form-overlay.is-open #report-form-modal {
    transform: scale(1) translateY(0);
  }
}

/* === VISIBILITY STATES === */
#report-form-overlay:not(.is-open) {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

#report-form-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

#report-form-overlay.is-open,
#report-form-overlay.is-open * {
  pointer-events: auto;
}

/* === rform COMPONENTS === */
.rform-handle {
  width: 40px;
  height: 4px;
  background: #e2e8f0;
  border-radius: 99px;
  margin: 12px auto 8px;
  flex-shrink: 0;
}

.rform-header {
  flex-shrink: 0;
  border-bottom: 1px solid #f1f5f9;
  padding: 0 20px 16px;
}

.qrs-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.qrs-eyebrow {
  font-size: 11px;
  font-weight: 800;
  color: #0B8F72;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 4px 0;
}

.qrs-title {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 0 0 4px 0;
}

.qrs-sub {
  font-size: 12px;
  color: #64748b;
  margin: 0;
}

.qrs-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.qrs-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.qrs-manual-wrap {
  margin-bottom: 16px;
  width: 100%;
}

.qrs-manual-btn {
  width: 100%;
  padding: 14px;
  border: 1.5px solid rgba(11, 143, 114, 0.25);
  border-radius: 999px;
  background: #fcfefe;
  color: #0B8F72;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.qrs-manual-btn:hover {
  background: rgba(11, 143, 114, 0.05);
  border-color: #0B8F72;
}

.qrs-manual-btn .material-symbols-outlined {
  font-size: 20px;
}

.qrs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.qrs-tile {
  border-radius: 20px;
  padding: 16px;
  border: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.qrs-tile:active {
  transform: scale(0.97);
}

.qrs-tile--scan {
  background: #e6f7f4;
}

.qrs-tile--case {
  background: #fff5f5;
}

.qrs-tile--water {
  background: #f0f9ff;
}

.qrs-tile--risk {
  background: #fffbeb;
}

.qrs-tile-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.qrs-tile-icon .material-symbols-outlined {
  color: white;
}

.qrs-tile-icon--scan {
  background: #006857;
}

.qrs-tile-icon--case {
  background: #e11d48;
}

.qrs-tile-icon--water {
  background: #0284c7;
}

.qrs-tile-icon--risk {
  background: #d97706;
}

.qrs-tile-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px 0;
}

.qrs-tile-desc {
  font-size: 10px;
  color: #64748b;
  margin: 0;
  line-height: 1.3;
}

.rform-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.rform-step {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 2px;
}

.rform-header h2 {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.4px;
  margin: 0;
}

.rform-header p {
  font-size: 12px;
  color: #64748b;
  margin: 2px 0 0;
}

.rform-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.rform-close:hover {
  background: #e2e8f0;
  color: #1e293b;
}

#rform-back-btn {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #475569;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.rform-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rform-scroll::-webkit-scrollbar {
  width: 4px;
}
.rform-scroll::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 2px;
}

.rform-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rform-label {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rform-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.rform-select-wrap .material-symbols-outlined {
  position: absolute;
  left: 12px;
  font-size: 18px;
  color: #006857;
  pointer-events: none;
}

.rform-select-wrap select {
  width: 100%;
  padding: 12px 12px 12px 40px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  background: #f8fafc;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.rform-select-wrap select:focus {
  border-color: #006857;
  background: white;
}

#rform-jenis-lainnya, #rform-deskripsi {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  background: #f8fafc;
  outline: none;
  resize: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

#rform-jenis-lainnya:focus, #rform-deskripsi:focus {
  border-color: #006857;
  background: white;
}

#rform-urgensi { display: none; }

.rform-urgency-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.rform-urgency-btn {
  flex: 1;
  padding: 12px 8px;
  border-radius: 14px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.rform-urgency-btn.is-active {
  border-color: currentColor;
}

.rform-urgency-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.rform-urgency-btn--mendesak .rform-urgency-dot {
  background-color: #dc2626;
}

.rform-urgency-btn--sedang .rform-urgency-dot {
  background-color: #d97706;
}

.rform-urgency-btn--rendah .rform-urgency-dot {
  background-color: #059669;
}

#urg-mendesak.is-active { color: #dc2626; background: #fef2f2; border-color: #fca5a5; }
#urg-sedang.is-active { color: #d97706; background: #fffbeb; border-color: #fcd34d; }
#urg-rendah.is-active { color: #059669; background: #f0fdf4; border-color: #6ee7b7; }

.rform-location-row {
  display: flex;
  gap: 10px;
  width: 100%;
  align-items: stretch;
}

#rform-location-info {
  flex: 1;
  padding: 12px 14px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
  min-width: 0;
  text-align: left;
}

#rform-location-info:hover {
  border-color: #006857;
  background: #f0fdf4;
}

#rform-loc-text {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#rform-loc-coords {
  font-size: 10px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.rform-media-btn {
  width: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  cursor: pointer;
  color: #64748b;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.rform-media-btn:hover {
  border-color: #006857;
  color: #006857;
  background: #f0fdf4;
}

/* Location Selector body and search classes */
#report-main-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#report-location-selector-body {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.rform-loc-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.rform-loc-search-wrap .material-symbols-outlined {
  position: absolute;
  left: 12px;
  font-size: 20px;
  color: #94a3b8;
  pointer-events: none;
}

.rform-loc-search-wrap input {
  width: 100%;
  padding: 12px 12px 12px 40px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  background: #f8fafc;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.rform-loc-search-wrap input:focus {
  border-color: #006857;
  background: white;
}

#loc-search-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-top: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
}

.rform-loc-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: white;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  font-family: 'Plus Jakarta Sans', sans-serif;
  margin-top: 8px;
}

.rform-loc-option:hover {
  border-color: #006857;
  background: #f8fafc;
}

.rform-loc-option-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rform-loc-option-icon--gps {
  background: #e0f2fe;
  color: #0284c7;
}

.rform-loc-option-icon--map {
  background: #dcfce7;
  color: #16a34a;
}

#rform-error {
  display: none;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #dc2626;
}

#rform-footer-main {
  padding: 16px 20px;
  border-top: 1px solid #f1f5f9;
  flex-shrink: 0;
}

#rform-submit-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #006857, #00a389);
  color: white;
  border: none;
  border-radius: 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(0, 104, 87, 0.3);
}

#rform-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 104, 87, 0.4);
}

#rform-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.report-chip {
  padding: 7px 16px;
  border-radius: 99px;
  border: 1.5px solid #e2e8f0;
  background: white;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.report-chip.active-chip {
  background: #006857;
  color: white;
  border-color: #006857;
}
