/* facilities.css - Styles for Facilities Finder page */

/* General Styles */
body {
  font-family: 'Noto Sans Sinhala', sans-serif;
  touch-action: pan-x pan-y;
}

#map {
  width: 100%;
  height: 480px;
}

.location-card {
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.location-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.loading-spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top: 4px solid #FF3600;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.card-image {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background-color: rgba(255, 54, 0, 0.9);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.directions-btn {
  background-color: #FF3600;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.directions-btn:hover {
  background-color: #e03100;
  transform: translateY(-1px);
}

.live-badge {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

.feature-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #FF3600;
  color: white;
  border-radius: 50%;
  margin-right: 6px;
}

.facility-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  margin-right: 6px;
  margin-bottom: 6px;
}

.facility-selector {
  position: relative;
}

.facility-selector input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.facility-selector label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: 12px;
  background-color: white;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  transition: all 0.2s;
}

.facility-selector input:checked + label {
  border-color: #FF3600;
  background-color: #fff7f5;
  box-shadow: 0 0 0 2px rgba(255, 54, 0, 0.2);
}

.facility-selector .icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  color: #6b7280;
}

.facility-selector input:checked + label .icon {
  color: #FF3600;
}

.facility-selector .label {
  font-size: 12px;
  font-weight: 500;
  color: #4b5563;
}

.facility-selector input:checked + label .label {
  color: #FF3600;
  font-weight: 600;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background-color: #f3f4f6;
  border-radius: 9999px;
  font-size: 13px;
  margin-right: 8px;
  margin-bottom: 8px;
}

.filter-chip .remove {
  margin-left: 6px;
  cursor: pointer;
  color: #9ca3af;
}

.filter-chip .remove:hover {
  color: #6b7280;
}

.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.no-results-icon {
  font-size: 48px;
  color: #FF3600;
  margin-bottom: 16px;
}

.pagination {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.pagination button {
  margin: 0 5px;
  padding: 5px 10px;
  border-radius: 5px;
  background-color: #FF3600;
  color: white;
  border: none;
  cursor: pointer;
}

.pagination button:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

.pagination-info {
  text-align: center;
  margin-top: 10px;
  color: #666;
}

.search-btn {
  background-color: #FF3600;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.search-btn:hover {
  background-color: #e03100;
  transform: translateY(-2px);
}

/* Rating Stars */
.rating {
  display: inline-flex;
  flex-direction: row-reverse;
}

.rating input {
  display: none;
}

.rating label {
  color: #ddd;
  font-size: 24px;
  cursor: pointer;
}

.rating input:checked ~ label {
  color: #FFD700;
}

.rating label:hover,
.rating label:hover ~ label {
  color: #FFD700;
}

/* Review Section */
.review-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease-out;
}

.review-panel.open {
  max-height: 1000px;
}

.review-item {
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.review-user {
  font-weight: 600;
  color: #374151;
}

.review-time {
  font-size: 12px;
  color: #9ca3af;
}

.review-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.review-react {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  transition: transform 0.2s;
}

.review-react:hover {
  transform: scale(1.2);
}

.review-delete {
  color: #ef4444;
  font-size: 12px;
  cursor: pointer;
}

.review-toggle-btn {
  background-color: #f3f4f6;
  color: #374151;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 16px;
}

.review-toggle-btn:hover {
  background-color: #e5e7eb;
}

.review-toggle-btn i {
  margin-left: 8px;
  transition: transform 0.3s;
}

.review-toggle-btn.open i {
  transform: rotate(180deg);
}

/* Dark Mode Styles */
.dark {
  background-color: #1a1a1a;
  color: #e5e7eb;
}

.dark .bg-white {
  background-color: #1f2937 !important;
}

.dark .text-gray-900 {
  color: #f3f4f6 !important;
}

.dark .text-gray-600 {
  color: #d1d5db !important;
}

.dark .bg-gray-50 {
  background-color: #111827 !important;
}

.dark .bg-gradient-to-br.from-white.via-orange-50.to-white {
  background: linear-gradient(to bottom right, #1f2937, #1a1a1a, #1f2937) !important;
}

.dark .border-gray-300 {
  border-color: #374151 !important;
}

.dark .bg-white\/80 {
  background-color: rgba(31, 41, 55, 0.8) !important;
}

.dark .bg-gray-100\/50 {
  background-color: rgba(17, 24, 39, 0.5) !important;
}

.dark .hover\:bg-gray-100\/50:hover {
  background-color: rgba(17, 24, 39, 0.5) !important;
}

.dark .hover\:text-gray-900:hover {
  color: #f3f4f6 !important;
}

.dark .review-user {
  color: #e5e7eb;
}

.dark .review-toggle-btn {
  background-color: #374151;
  color: #e5e7eb;
}

.dark .review-toggle-btn:hover {
  background-color: #4b5563;
}

/* Dark Mode Toggle Switch Styling */
.dark-mode-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.dark-mode-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.dark-mode-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

.dark-mode-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .dark-mode-slider {
  background-color: #FF3600;
}

input:checked + .dark-mode-slider:before {
  transform: translateX(26px);
}

.dark-mode-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: white;
}

.sun-icon {
  left: 6px;
}

.moon-icon {
  right: 6px;
}

/* Mobile Navigation Styles */
@media (max-width: 767px) {
  #map {
    height: 350px;
  }
  
  .facility-selector {
    margin-bottom: 8px;
  }
  
  .location-card {
    margin-bottom: 16px;
  }
  
  .filter-chip {
    font-size: 12px;
    padding: 3px 8px;
  }
  
  .pagination button {
    padding: 8px 12px;
    font-size: 14px;
  }
}

/* Tablet Styles */
@media (min-width: 768px) and (max-width: 1023px) {
  #map {
    height: 420px;
  }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .directions-btn {
    border: 2px solid white;
  }
  
  .facility-selector input:checked + label {
    border-width: 2px;
  }
}