frontend/app/globals.css
@import "tailwindcss";

/* Global styles */
html {
  height: 100%;
}

body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#__next {
  height: 100%;
}

/* Leaflet map styles */
.leaflet-container {
  height: 100%;
  width: 100%;
  z-index: 1;
}

/* Ensure map resizes properly when form sidebar opens/closes */
.leaflet-container .leaflet-control-container {
  transition: all 0.3s ease-in-out;
}

/* Custom scrollbar */
.scrollbar-thin {
  scrollbar-width: thin;
  scrollbar-color: rgb(156 163 175) transparent;
}

.scrollbar-thin::-webkit-scrollbar {
  width: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
  background-color: rgb(156 163 175);
  border-radius: 3px;
  transition: background-color 0.2s ease;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background-color: rgb(107 114 128);
}

/* Enhanced scrollbar for form sections */
.form-section-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgb(59 130 246 / 0.3) transparent;
}

.form-section-scroll::-webkit-scrollbar {
  width: 8px;
}

.form-section-scroll::-webkit-scrollbar-track {
  background: rgb(243 244 246);
  border-radius: 4px;
  margin: 4px 0;
}

.form-section-scroll::-webkit-scrollbar-thumb {
  background-color: rgb(59 130 246 / 0.3);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.form-section-scroll::-webkit-scrollbar-thumb:hover {
  background-color: rgb(59 130 246 / 0.6);
}

.form-section-scroll::-webkit-scrollbar-thumb:active {
  background-color: rgb(59 130 246 / 0.8);
}

/* Line clamp utility */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Custom focus styles */
.focus-ring {
  @apply focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2;
}

/* Custom button styles */
.btn-primary {
  @apply bg-blue-600 text-white px-4 py-2 rounded-lg font-medium hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:bg-gray-300 disabled:cursor-not-allowed transition-colors;
}

.btn-secondary {
  @apply bg-gray-200 text-gray-800 px-4 py-2 rounded-lg font-medium hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 transition-colors;
}

.btn-danger {
  @apply bg-red-600 text-white px-4 py-2 rounded-lg font-medium hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 transition-colors;
}

/* Card styles */
.card {
  @apply bg-white rounded-lg shadow border border-gray-200;
}

.card-header {
  @apply px-4 py-3 border-b border-gray-200;
}

.card-body {
  @apply p-4;
}

/* Form styles */
.form-input {
  @apply w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent;
}

.form-label {
  @apply block text-sm font-medium text-gray-700 mb-1;
}

.form-error {
  @apply text-sm text-red-600 mt-1;
}

/* Animation utilities */
.animate-fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

.animate-slide-in-right {
  animation: slideInRight 0.3s ease-in-out;
}

.animate-slide-in-left {
  animation: slideInLeft 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

/* Loading spinner */
.spinner {
  @apply animate-spin rounded-full border-2 border-gray-300 border-t-blue-600;
}

.hide-scrollbar {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE 10+ */
}

.hide-scrollbar::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* Form sidebar specific styles */
.form-sidebar {
  transition: transform 0.3s ease-in-out, width 0.3s ease-in-out;
}

.form-sidebar.open {
  transform: translateX(0);
}

.form-sidebar.closed {
  transform: translateX(100%);
}

.form-sidebar.minimized {
  width: 3rem;
}

/* Map adjustment for form sidebar */
.map-container {
  transition: margin-right 0.3s ease-in-out;
}

.map-container.form-open {
  margin-right: 24rem; /* 384px - same as form width */
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .map-container.form-open {
    margin-right: 0; /* Full screen on mobile */
  }
  
  .form-sidebar {
    width: 100vw !important;
  }
}

/* Ensure map controls are visible when form is open */
.leaflet-control-zoom {
  z-index: 10;
}

.leaflet-control-attribution {
  z-index: 10;
}

/* Point selection cursor */
.leaflet-container.selecting-points {
  cursor: crosshair !important;
}

.leaflet-container.selecting-points .leaflet-clickable {
  cursor: crosshair !important;
}

/* Point selection markers */
.selection-marker {
  background-color: #3b82f6;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.selection-line {
  stroke: #3b82f6;
  stroke-width: 3;
  stroke-dasharray: 5, 5;
  stroke-opacity: 0.8;
  fill: none;
}

/* Form step indicator */
.step-indicator {
  transition: all 0.3s ease-in-out;
}

.step-indicator.active {
  background-color: #3b82f6;
  color: white;
  transform: scale(1.1);
}

.step-indicator.completed {
  background-color: #10b981;
  color: white;
}

/* Smooth transitions for all form elements */
.form-field {
  transition: all 0.2s ease-in-out;
}

.form-field:focus-within {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

/* Success/error states */
.field-success {
  border-color: #10b981;
  background-color: #f0fdf4;
}

.field-error {
  border-color: #ef4444;
  background-color: #fef2f2;
}

/* Custom radio button styles for better UX */
.radio-option {
  transition: all 0.2s ease-in-out;
}

.radio-option:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.radio-option.selected {
  border-color: #3b82f6;
  background-color: #eff6ff;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Notification positioning adjustments for sidebar */
.toast-container {
  z-index: 60; /* Higher than form sidebar */
}

/* Ensure tooltips and popovers appear above form */
.leaflet-tooltip,
.leaflet-popup {
  z-index: 55;
}

/* Mobile-specific adjustments */
@media (max-width: 640px) {
  .form-sidebar {
    top: 0;
    height: 100vh;
    border-radius: 0;
  }
  
  .form-sidebar .minimize-button {
    display: none; /* Hide minimize on mobile */
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  .form-sidebar,
  .map-container,
  .step-indicator,
  .form-field,
  .radio-option {
    transition: none;
  }
  
  .animate-fade-in,
  .animate-slide-in-right,
  .animate-slide-in-left {
    animation: none;
  }
}