/**
 * Location Component Styles
 * Additional styles not covered by Tailwind CSS
 */

/* ===================================
   Map Container
   =================================== */
.location-component #location-map {
  position: relative;
  background-color: #f5f5f5;
}

/* Ensure map renders correctly */
.location-component .gm-style {
  font-family: inherit !important;
}

/* ===================================
   Info Window Customization
   =================================== */

/* Override Google Maps info window styles */
.gm-style .gm-style-iw-c {
  padding: 0 !important;
  border-radius: 4px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

.gm-style .gm-style-iw-d {
  overflow: hidden !important;
  max-height: 400px !important;
}

/* Remove default content wrapper padding */
.gm-style .gm-style-iw-chr {
  position: absolute;
  top: 8px;
  right: 8px;
  /* Hide the X button */
  display: none;
}

/* Style close button */
.gm-style .gm-style-iw-chr button {
  width: 24px !important;
  height: 24px !important;
}

/* Info window close button */
.gm-style .gm-style-iw-t::after {
  background: linear-gradient(45deg, #FDB71A 50%, #23201F 50%) !important;
}

/* Custom scrollbar for multi-location info windows */
.location-list-scroll::-webkit-scrollbar {
  width: 8px;
}

.location-list-scroll::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.location-list-scroll::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.location-list-scroll::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* ===================================
   Location List Items
   =================================== */

.location-list-item {
  transition: background-color 0.2s ease;
}

.location-list-item:hover {
  background-color: #f9fafb;
}

.location-list-item:active {
  background-color: #f3f4f6;
}

/* Make entire list item clickable */
.location-list-item {
  cursor: pointer;
}

/* Status badge */
.status-badge {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
}

.status-badge.open {
  color: #00A94F;
}

.status-badge.closed {
  color: #6B7280;
}

/* ===================================
   Custom Markers
   =================================== */

/* Marker animation */
@keyframes markerBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.marker-bounce {
  animation: markerBounce 0.5s ease-in-out;
}

/* Cluster marker */
.cluster-marker {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.cluster-marker:hover {
  transform: scale(1.1);
}

/* Location count badge on markers */
.location-count-badge {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===================================
   Mobile Optimizations
   =================================== */

@media (max-width: 768px) {
  /* Adjust map height on mobile */
  .location-component #location-map {
    min-height: 400px;
  }

  /* Make location list scrollable on mobile */
  .location-sidebar {
    max-height: none !important;
  }

  .location-list {
    max-height: 500px;
  }

  /* Smaller info window on mobile */
  .gm-style .gm-style-iw-c {
    max-width: 280px !important;
  }
}

/* ===================================
   Loading States
   =================================== */

.location-component [x-cloak] {
  display: none !important;
}

/* Skeleton loader for location list */
.location-list-skeleton {
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.skeleton-line {
  height: 12px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 8px;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* ===================================
   Filter Panel
   =================================== */

.location-sidebar .shadow-figma {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Custom checkbox styles for division filters */
input[type="checkbox"]:checked + span {
  border-color: #B08600 !important;
}

/* ===================================
   Accessibility
   =================================== */

/* Focus styles for keyboard navigation */
.location-list-item:focus {
  outline: 2px solid #FDB71A;
  outline-offset: -2px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #FDB71A;
  outline-offset: 2px;
}

/* ===================================
   Print Styles
   =================================== */

@media print {
  /* Hide map on print */
  .map-container {
    display: none !important;
  }

  /* Expand location list for print */
  .location-sidebar {
    width: 100% !important;
    max-height: none !important;
  }

  .location-list {
    max-height: none !important;
    overflow: visible !important;
  }

  /* Show all locations when printing */
  .location-list-item {
    page-break-inside: avoid;
  }
}

/* ===================================
   Google Maps Controls Customization
   =================================== */

/* Adjust zoom control position */
.gm-bundled-control {
  margin: 10px !important;
}

/* Fullscreen control */
.gm-fullscreen-control {
  background-color: white !important;
  border-radius: 2px !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

/* ===================================
   Error States
   =================================== */

.location-component .error-message {
  padding: 1rem;
  background-color: #FEE2E2;
  border: 1px solid #FCA5A5;
  color: #991B1B;
  border-radius: 4px;
  margin: 1rem;
}

/* ===================================
   Transitions
   =================================== */

.location-component * {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth transitions for Alpine.js show/hide */
[x-cloak] {
  display: none !important;
}

.location-component-drawer h1,h2,h3,h4,h5,h6 {
  color: #231f20;
}
.location-component-drawer .make-full-width {
  padding: 50px 1.25rem;
}
