/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Base Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #2c3e50;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-attachment: fixed;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* Navigation */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  padding: 1rem 0;
  margin-bottom: 2rem;
}

.nav-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  transition: all 0.3s ease;
}

.nav-brand:hover {
  transform: scale(1.05);
  filter: brightness(1.2);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-link {
  text-decoration: none;
  color: #475569;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: #1e293b;
  background-color: #f1f5f9;
}

.nav-text {
  color: #64748b;
  font-size: 0.9rem;
}

.btn-outline {
  background-color: white;
  color: #64748b;
  border: 2px solid #cbd5e1;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.btn-outline:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
  color: #475569;
}

/* Google Sign-in Button */
.btn-google {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background-color: white;
  color: #3c4043;
  border: 1px solid #dadce0;
  padding: 0.625rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.btn-google:hover {
  background-color: #f8f9fa;
  box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
}

.btn-google:active {
  background-color: #f1f3f4;
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.google-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Hero Section */
.hero-section {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 3rem 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.hero-content {
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  margin: 0 0 1rem 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: #64748b;
  margin: 0;
  font-weight: 400;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

/* Instructions Card */
.instructions-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.instructions-card h2 {
  margin: 0 0 2rem 0;
  color: #1e293b;
  font-size: 1.75rem;
}

.instructions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  text-align: left;
}

.instruction-step {
  position: relative;
}

.step-number {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.instruction-step h3 {
  margin: 0 0 0.75rem 0;
  color: #1e293b;
  font-size: 1.25rem;
  font-weight: 600;
}

.instruction-step p {
  margin: 0;
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Map Container */
.map-container {
  height: 600px;
  margin-bottom: 2rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
  border: 3px solid rgba(255, 255, 255, 0.5);
}

/* Config Card */
.config-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.config-card h3 {
  margin: 0 0 1.5rem 0;
  color: #1e293b;
  font-size: 1.5rem;
}

/* Typography */
h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 1.5rem 0;
  color: #1a202c;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: #2d3748;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  color: #2d3748;
}

/* Status Section */
.status-section {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.status-section h2 {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-section h2 span {
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
}

/* Progress Info */
.progress-info {
  background: #f7fafc;
  border-left: 4px solid #4299e1;
  padding: 1rem 1.5rem;
  border-radius: 4px;
}

.progress-info p {
  margin: 0.5rem 0;
  color: #2d3748;
}

.progress-info p:first-child {
  font-weight: 600;
}

/* Success Info */
.success-info {
  background: #f0fdf4;
  border-left: 4px solid #10b981;
  padding: 1rem 1.5rem;
  border-radius: 4px;
}

.success-info p {
  margin: 0 0 1rem 0;
  color: #065f46;
  font-weight: 600;
}

/* Error Info */
.error-info {
  background: #fef2f2;
  border-left: 4px solid #ef4444;
  padding: 1rem 1.5rem;
  border-radius: 4px;
}

.error-info p {
  margin: 0 0 1rem 0;
  color: #991b1b;
  font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.btn-success {
  background-color: #10b981;
  color: white;
  border: 2px solid #10b981;
}

.btn-success:hover {
  background-color: #059669;
  border-color: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5568d3 0%, #63408a 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-generate {
  display: block;
  width: 100%;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-generate:hover {
  background: linear-gradient(135deg, #5568d3 0%, #63408a 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.btn-secondary {
  background-color: white;
  color: #475569;
  border: 2px solid #cbd5e1;
}

.btn-secondary:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Reference Map */
.reference-map {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.reference-map h3 {
  margin-bottom: 1rem;
}

#reference-map-container {
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Config Details */
.config-details {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.config-details h3 {
  margin-bottom: 1rem;
}

.config-details ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.config-details li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f5f9;
  color: #475569;
}

.config-details li:last-child {
  border-bottom: none;
}

.config-details li strong {
  color: #1e293b;
}

/* Flash Messages */
#flash-messages {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  max-width: 400px;
}

.flash-message {
  padding: 1rem 1.25rem;
  margin-bottom: 10px;
  border-radius: 6px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.3s ease-out;
}

.flash-alert {
  background-color: #fef2f2;
  color: #991b1b;
  border: 2px solid #fecaca;
}

.flash-notice {
  background-color: #f0fdf4;
  color: #065f46;
  border: 2px solid #bbf7d0;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Form Elements */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #1e293b;
  font-weight: 600;
  font-size: 0.95rem;
}

.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.form-select:hover {
  border-color: #cbd5e1;
}

.form-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Range Slider */
.range-display {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.range-slider {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #667eea, #764ba2);
  outline: none;
  -webkit-appearance: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  border: 3px solid #667eea;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.range-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  border: 3px solid #667eea;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.range-value {
  min-width: 40px;
  text-align: center;
  font-weight: 600;
  color: #667eea;
  font-size: 1.1rem;
}

/* Checkbox Cards */
.checkbox-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.checkbox-card:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.checkbox-card .form-check-input {
  margin-top: 0.25rem;
  cursor: pointer;
  width: 20px;
  height: 20px;
  border: 2px solid #cbd5e1;
  border-radius: 4px;
}

.checkbox-card .form-check-input:checked {
  background-color: #667eea;
  border-color: #667eea;
}

.checkbox-content {
  flex: 1;
}

.checkbox-label {
  display: block;
  margin-bottom: 0.25rem;
  color: #1e293b;
  font-weight: 600;
  cursor: pointer;
}

.checkbox-desc {
  display: block;
  color: #64748b;
  font-size: 0.9rem;
}

.form-check {
  padding-left: 1.5rem;
}

.form-check-input {
  margin-top: 0.3rem;
  cursor: pointer;
}

.form-check-label {
  cursor: pointer;
  font-weight: 500;
}

.form-text {
  display: block;
  margin-top: 0.25rem;
  margin-left: 1.5rem;
  font-size: 0.875rem;
  color: #6c757d;
}

/* Dashboard Styles */
.dashboard-actions {
  margin-bottom: 2rem;
}

.empty-state {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 2px dashed rgba(102, 126, 234, 0.3);
  border-radius: 12px;
  padding: 4rem 3rem;
  text-align: center;
  color: #64748b;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.empty-state p {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  color: #1e293b;
}

.maps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.map-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.map-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(102, 126, 234, 0.2);
  border-color: rgba(102, 126, 234, 0.3);
}

.map-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.map-card-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-pending {
  background-color: #fef3c7;
  color: #92400e;
}

.status-processing {
  background-color: #dbeafe;
  color: #1e40af;
}

.status-completed {
  background-color: #d1fae5;
  color: #065f46;
}

.status-failed {
  background-color: #fee2e2;
  color: #991b1b;
}

.map-card-body {
  padding: 1.25rem;
}

.map-info {
  margin-bottom: 1rem;
}

.map-info p {
  margin: 0.5rem 0;
  color: #475569;
  font-size: 0.9rem;
}

.map-info strong {
  color: #1e293b;
}

.map-thumbnail {
  margin-top: 1rem;
}

.thumbnail-map {
  width: 100%;
  height: 200px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  overflow: hidden;
}

.map-card-actions {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid #e2e8f0;
  background-color: #f8fafc;
}

.map-card-actions .btn {
  flex: 1;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.btn-warning {
  background-color: #f59e0b;
  color: white;
  border: 2px solid #f59e0b;
}

.btn-warning:hover {
  background-color: #d97706;
  border-color: #d97706;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-group {
  display: flex;
  gap: 0.5rem;
}

/* Leaflet Draw Customization */
/* Style the region selector button */
.leaflet-draw-toolbar a {
  background-color: #667eea !important;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.leaflet-draw-toolbar a:hover {
  background-color: #764ba2 !important;
  transform: scale(1.1);
}

/* Add custom icon/text to rectangle button */
.leaflet-draw-draw-rectangle::after {
  content: "📍";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  pointer-events: none;
}

/* Change the rectangle icon to be more symbolic */
.leaflet-draw-draw-rectangle {
  background-image: none !important;
  position: relative;
}

/* Add tooltip text */
.leaflet-draw-draw-rectangle:hover::before {
  content: "Select Region";
  position: absolute;
  bottom: -30px;
  left: 50px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1000;
}
