/*
 * 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.
 */

/* Pagination Styles */
.pagination {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
}

.pagination a,
.pagination span {
  padding: 0.4rem 0.6rem;
  border-radius: 0.375rem;
  transition: all 0.2s;
}

.pagination a {
  border: 1px solid #e5e7eb;
  color: #2563eb;
  text-decoration: none;
}

.pagination a:hover {
  background-color: #eff6ff;
  border-color: #bfdbfe;
}

.pagination .current {
  background-color: #3b82f6;
  color: white;
  border: 1px solid #3b82f6;
  font-weight: 600;
}

.pagination .disabled {
  color: #d1d5db;
  cursor: not-allowed;
}

.pagination .gap {
  color: #9ca3af;
}

/* Map Popup Styles */
.leaflet-popup-content-wrapper {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 4px !important;
  padding: 0 !important;
  overflow: visible !important;
}

.leaflet-popup {
  overflow: visible !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  padding: 0 !important;
  width: 260px !important;
  background: none !important;
  box-shadow: none !important;
  border: none !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

.map-popup {
  width: 260px;
  border-radius: 4px;
  overflow: visible !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  background: white;
}

@media (max-width: 768px) {
  .map-popup {
    width: 220px;
  }
}

@media (max-width: 480px) {
  .map-popup {
    width: 180px;
  }
}

.map-popup-header {
  padding: 10px;
  font-weight: 600;
  font-size: 13px;
  color: white !important;
  display: block !important;
  background-color: #afafaf;
  width: 100% !important;
  box-sizing: border-box !important;
  white-space: normal !important;
  line-height: 1.4;
  min-height: 32px;
  overflow: visible !important;
}

.leaflet-popup-close-button {
  background-color: rgba(255, 255, 255, 0.2) !important;
  color: white !important;
  top: 8px !important;
  right: 8px !important;
  width: 24px !important;
  height: 22px !important;
  font-size: 18px !important;
  line-height: 1 !important;
  border-radius: 3px !important;
}

.map-popup-content {
  padding: 12px;
  background: white;
  font-size: 12px;
  width: 100%;
  box-sizing: border-box;
}

.map-popup-ward-name {
  margin: 0 0 0.2em 0 !important;
  font-weight: 600;
}

.map-popup-ward-councillor-label {
  margin: 0 0 0.2em 0 !important;
}

.map-popup-ward-councillor-name {
  margin: 0 0 0.8em 0 !important;
  font-weight: 600;
}

.map-popup-ward-report-count-container {
  margin: 0.8em 0 !important;
}
.map-popup-ward-report-count {
  margin: 0 !important;
  font-size: 11px;
  color: #6b7280;
}

.map-popup-location {
  margin-bottom: 10px;
  font-size: 12px;
  color: #1f2937;
  display: flex;
  gap: 6px;
}

.map-popup-location-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.map-popup-ward {
  margin-bottom: 12px;
  font-size: 11px;
  color: #6b7280;
}

.map-popup-button {
  background-color: #16a34a !important;
  color: white !important;
  padding: 3px 9px !important;
  border-radius: 99px !important;
  text-decoration: none !important;
  font-weight: 400 !important;
  font-size: 10px !important;
  display: inline-block !important;
  cursor: pointer !important;
  border: none !important;
  transition: opacity 0.2s !important;
}

/* Report Map Container */
#report-map {
  margin-top: 1rem !important;
  z-index: 1 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

/* Leaflet Popup Text Color - Visible text in popup */
.leaflet-popup-text-color .leaflet-popup-content {
  color: #1f2937 !important;
  font-size: 14px;
  line-height: 1.6;
  margin: 0 !important;
  padding: 0 !important;
}

.leaflet-popup-text-color .leaflet-popup-content-wrapper {
  background-color: white !important;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2) !important;
  border-radius: 8px !important;
  padding: 12px 14px !important;
}

.leaflet-popup-text-color .leaflet-popup-tip {
  background-color: white !important;
  border: none !important;
}

.popup-content {
  padding: 0 !important;
}

.popup-issue {
  font-weight: 600;
  font-size: 15px;
  color: #1f2937;
  margin-bottom: 8px;
}

.popup-address {
  font-size: 13px;
  color: #4b5563;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Homepage Animations & Enhancements */

/* Pulse glow animation for CTAs */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 4px 14px 0 rgba(220, 102, 1, 0.3);
  }
  50% {
    box-shadow: 0 4px 20px 0 rgba(220, 102, 1, 0.4);
  }
}

.animate-pulse-glow {
  animation: pulse-glow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Hover lift effect for cards */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(220, 102, 1, 0.15);
}

/* Pulsing dot for new items */
@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

.animate-pulse-dot {
  animation: pulse-dot 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Slide in from top animation */
@keyframes slide-in-top {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-in-top {
  animation: slide-in-top 0.5s ease-out;
}

/* Slide in from left animation (staggered for activity feed) */
@keyframes slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

/* Skeleton loader shimmer */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.skeleton-loader {
  background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 50%, #f3f4f6 100%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* Report card enhancements */
.report-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.report-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(220, 102, 1, 0.12);
}

.report-card.new-report {
  position: relative;
}

.report-card.new-report::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, #DC6601, #F97316);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: pulse-dot 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Progress bar */
.progress-bar {
  height: 4px;
  background: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #DC6601, #F97316);
  transition: width 0.5s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .animate-pulse-glow,
  .animate-pulse-dot,
  .animate-slide-in-top,
  .animate-slide-in-left,
  .skeleton-loader,
  .progress-bar-fill::after {
    animation: none;
  }

  .hover-lift:hover,
  .report-card:hover {
    transform: none;
  }
}
