/* LandForms - Global Styles */

h1, h2, h3, h4, h5, h6 {
  font-family: 'DM Serif Display', serif;
}

body {
  font-family: 'Inter', sans-serif;
}

/* Smooth scrolling */
html { scroll-behavior: smooth; }

/* Scroll reveal for homepage sections */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f8fafc; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Map styles */
#map-container { position: relative; }
#map-container .gm-style { border-radius: 12px; }

/* Search dropdown */
.lmm-search-container { position: relative; }
.lmm-search-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #E5E0D8;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 100;
  max-height: 320px;
  overflow-y: auto;
}
.lmm-search-dropdown.active { display: block; }

.lmm-search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.lmm-search-result:hover,
.lmm-search-result.selected { background: #f0f7f0; }

.lmm-result-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.lmm-result-icon.state { background: #dbeafe; color: #2563eb; }
.lmm-result-icon.county { background: #fef3c7; color: #d97706; }
.lmm-result-icon.township { background: #d1fae5; color: #059669; }
.lmm-result-icon.section { background: #ede9fe; color: #7c3aed; }

.lmm-result-name { font-weight: 500; font-size: 14px; color: #1F2937; }
.lmm-result-meta { font-size: 12px; color: #9ca3af; }

/* Boundary tooltip */
#boundaryTooltip {
  display: none;
  position: absolute;
  background: rgba(30,30,30,0.9);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  pointer-events: none;
  z-index: 200;
  white-space: nowrap;
}

/* CDL zoom warning */
.cdl-zoom-warning {
  display: none;
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.75);
  color: white;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  z-index: 100;
  white-space: nowrap;
}

/* Map layer controls */
.map-layer-btn {
  background: white;
  border: 1px solid #E5E0D8;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  color: #1F2937;
}
.map-layer-btn:hover { background: #f0f7f0; border-color: #4A6741; }
.map-layer-btn .indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ca3af;
  transition: background 0.15s;
}
.map-layer-btn .indicator.active { background: #10b981; }

/* Form builder */
.field-palette-item {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: grab;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  transition: all 0.15s;
}
.field-palette-item:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}
.field-palette-item:active { cursor: grabbing; }

/* ─── FIELD CARDS (sortable) ────────────────────────────── */

.field-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: grab;
  touch-action: none;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  position: relative;
  user-select: none;
  cursor: pointer;
}
.field-card:hover {
  border-color: #bfdbfe;
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.08);
}
.field-card.selected {
  border-color: #3b82f6;
  background: #f8faff;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12), 0 4px 12px rgba(59, 130, 246, 0.06);
}

/* Drag handle */
.drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 30px;
  color: #cbd5e1;
  cursor: grab;
  border-radius: 6px;
  transition: all 0.15s;
  flex-shrink: 0;
}
.drag-handle:hover {
  color: #3b82f6;
  background: #eff6ff;
}
.drag-handle:active { cursor: grabbing; }

/* Icon badge */
.field-icon-badge {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  transition: all 0.15s;
}
.field-card.selected .field-icon-badge {
  background: #2563eb;
  color: white;
}

/* Action buttons */
.field-actions {
  opacity: 0;
  transition: opacity 0.15s;
}
.field-card:hover .field-actions { opacity: 1; }
.field-card.selected .field-actions { opacity: 1; }

.field-action-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 13px;
  color: #9ca3af;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  background: transparent;
}
.field-action-delete:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* Ghost card (floating during drag) */
.drag-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

.field-card-ghost {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18), 0 0 0 1.5px rgba(59, 130, 246, 0.3);
  border-color: #3b82f6 !important;
  background: white;
  border-radius: 12px;
  scale: 1.02;
  opacity: 0.95;
  cursor: grabbing;
  transition: box-shadow 0.2s, scale 0.2s, opacity 0.2s;
}

/* Drop placeholder */
.drag-placeholder {
  border: 2px dashed rgba(59, 130, 246, 0.35);
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.03);
  transition: height 0.2s cubic-bezier(0.2, 0, 0, 1);
  animation: placeholderPulse 2s ease infinite;
}
@keyframes placeholderPulse {
  0%, 100% { border-color: rgba(59, 130, 246, 0.3); }
  50% { border-color: rgba(59, 130, 246, 0.6); }
}

/* Field enter/exit animations */
.field-card-enter {
  animation: fieldEnter 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes fieldEnter {
  0% { opacity: 0; transform: translateY(-8px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.field-card-exit {
  animation: fieldExit 0.25s ease forwards;
  pointer-events: none;
}
@keyframes fieldExit {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.9) translateX(20px); max-height: 0; padding: 0; margin: 0; overflow: hidden; }
}

/* Properties panel entrance */
.prop-panel-content {
  animation: propSlideIn 0.2s ease;
}
@keyframes propSlideIn {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Enrichment data card */
.enrichment-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}
.enrichment-card-header {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: white;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.enrichment-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.enrichment-badge.pending { background: #fef3c7; color: #92400e; }
.enrichment-badge.success { background: #d1fae5; color: #065f46; }
.enrichment-badge.error { background: #fee2e2; color: #991b1b; }

.enrichment-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}
.enrichment-row:last-child { border-bottom: none; }
.enrichment-label { color: #6b7280; font-weight: 500; }
.enrichment-value { color: #1F2937; text-align: right; max-width: 60%; }

/* Loading spinner */
.loading-spinner { animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── EMAIL CHIPS ───────────────────────────────────────── */

.email-chips-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: text;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.email-chips-container:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.email-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.email-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 4px 3px 10px;
  background: #2563eb;
  color: white;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  animation: chipIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: background 0.15s, transform 0.15s;
}
.email-chip:hover { background: #1d4ed8; }

.email-chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  transition: background 0.15s, transform 0.15s;
}
.email-chip-remove:hover {
  background: rgba(255,255,255,0.35);
  transform: scale(1.15);
}

.email-chip-input {
  flex: 1;
  min-width: 180px;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  padding: 4px 2px;
  color: #1F2937;
}
.email-chip-input::placeholder { color: #9ca3af; }

@keyframes chipIn {
  0% { opacity: 0; transform: scale(0.6); }
  100% { opacity: 1; transform: scale(1); }
}

.shake {
  animation: shake 0.35s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.pulse-highlight {
  animation: pulseHighlight 0.5s ease;
}
@keyframes pulseHighlight {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25); }
}

/* ─── TOGGLE SWITCH ─────────────────────────────────────── */

.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #d1d5db;
  border-radius: 22px;
  transition: background 0.25s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-slider { background: #2563eb; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }
.toggle-switch input:focus-visible + .toggle-slider { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }

/* ─── MODAL ANIMATIONS ──────────────────────────────────── */

.modal-backdrop {
  animation: fadeIn 0.2s ease;
}
.modal-content {
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── MICRO-INTERACTIONS ────────────────────────────────── */

/* Buttons get a subtle press effect */
button:not(:disabled):active,
a[class*="bg-primary"]:active,
a[class*="bg-accent"]:active {
  transform: scale(0.97);
}

/* Card hover lift */
.field-card:active { cursor: grabbing; }

/* Smooth focus transitions for all inputs */
input, textarea, select {
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
input:focus, textarea:focus, select:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Enrichment toggle hover */
#enrichment-toggles label {
  transition: all 0.2s;
}
#enrichment-toggles label:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Palette item hover bounce */
.field-palette-item {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.field-palette-item:hover {
  transform: translateX(3px);
}

/* ─── STAGGERED CARD ENTRANCE ───────────────────────────── */

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── SKELETON LOADING ──────────────────────────────────── */

.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── SMOOTH PAGE TRANSITIONS ───────────────────────────── */

.p-6, .p-10 {
  animation: pageIn 0.3s ease;
}
@keyframes pageIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Sidebar (legacy) */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  position: relative;
}
.sidebar-link:hover {
  background: #f1f5f9;
  color: #334155;
}
.sidebar-link.active {
  background: #eff6ff;
  color: #2563eb;
}
.sidebar-link.active:hover { transform: none; }

/* Signature pad */
.signature-pad {
  border: 2px dashed #e2e8f0;
  border-radius: 8px;
  background: white;
  cursor: crosshair;
}
.signature-pad:hover { border-color: #3b82f6; }

/* Star rating */
.star-rating { display: flex; gap: 4px; }
.star-rating .star {
  font-size: 24px;
  cursor: pointer;
  color: #e2e8f0;
  transition: color 0.1s;
}
.star-rating .star.active { color: #f59e0b; }
.star-rating .star:hover { color: #f59e0b; }

/* Integration pills */
.integration-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  color: #374151;
  white-space: nowrap;
  transition: all 0.15s;
}
.integration-pill:hover {
  border-color: #FF4A00;
  color: #FF4A00;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 74, 0, 0.08);
}
.integration-pill-more {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: #FF4A00;
  border: 1px solid #FF4A00;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
}

/* Integration logo grid (homepage) */
.integration-logo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 12px;
  background: white;
  border: 1px solid #E5E0D8;
  border-radius: 16px;
  transition: all 0.2s ease;
}
.integration-logo-card:hover {
  border-color: #FF4A00;
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(255, 74, 0, 0.08);
}
.integration-logo-card img, .integration-logo-card svg {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.integration-logo-card span {
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  text-align: center;
}

@keyframes floatIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.integration-animate {
  opacity: 0;
  animation: floatIn 0.4s ease forwards;
}

/* Success modal animations */
.success-check-circle {
  animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}
.success-check-icon path {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: checkDraw 0.4s ease 0.4s forwards;
}
@keyframes successPop {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes checkDraw {
  to { stroke-dashoffset: 0; }
}
