body {
  font-family: "Segoe UI", Tahoma, sans-serif;
  margin: 0;
  padding: 0;
  background: #f5f5f5;
  color: #333;
  direction: rtl;
}

header {
  background: linear-gradient(90deg, #2e7d32, #66bb6a);
  color: #fff;
  padding: 1rem;
  text-align: center;
}

header h1 {
  margin: 0 0 0.5rem 0;
}

.holiday-greeting {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.95;
  animation: gentlePulse 3s ease-in-out infinite;
}

@keyframes gentlePulse {
  0%, 100% {
    opacity: 0.95;
  }
  50% {
    opacity: 1;
  }
}

main {
  padding: 1rem;
  max-width: 800px;
  margin: 1rem auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e0e0;
}

#search-container {
  max-width: 800px;
  margin: 1rem auto;
  display: flex;
  justify-content: center;
}

#controls {
  max-width: 800px;
  margin: 0 auto 1rem auto;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}


#controls label {
  font-weight: bold;
}

#distanceRange {
  width: 200px;
  transition: opacity 0.3s ease, cursor 0.3s ease;
}

#distanceRange[data-search-active="true"] {
  opacity: 0.5;
  cursor: pointer;
}

#sortBy {
  padding: 0.4rem 0.6rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
}

#search {
  width: 100%;
  max-width: 500px;
  padding: 0.8rem 1.2rem;
  font-size: 1.1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}

#status {
  margin-bottom: 1rem;
  font-weight: bold;
}

/* Empty states */
#stations > p {
  text-align: center;
  color: #666;
  font-style: italic;
  padding: 2rem;
  margin: 0;
}

/* Focus indicators for accessibility */
#search:focus,
#distanceRange:focus,
#sortBy:focus {
  outline: 2px solid #2e7d32;
  outline-offset: 2px;
}

/* נגישות - ניגודיות גבוהה */
body.high-contrast {
  background: #000 !important;
  color: #fff !important;
}

body.high-contrast main {
  background: #000 !important;
  color: #fff !important;
  border: 2px solid #fff !important;
}

body.high-contrast .station {
  background: #000 !important;
  color: #fff !important;
  border: 1px solid #fff !important;
}

body.high-contrast #search,
body.high-contrast #sortBy {
  background: #000 !important;
  color: #fff !important;
  border: 1px solid #fff !important;
}

/* נגישות - רווחים מורחבים */
body.increased-spacing {
  line-height: 2 !important;
}

body.increased-spacing .station {
  margin-bottom: 2rem !important;
  padding: 1.5rem !important;
}

body.increased-spacing .station .actions {
  gap: 1rem !important;
}

body.increased-spacing .station .actions a {
  padding: 0.8rem 1.5rem !important;
  margin: 0.5rem 1rem 0.5rem 0 !important;
}

.station {
  background: #fff;
  border-radius: 8px;
  margin-bottom: 1rem;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.station h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
}

.station .price {
  font-size: 1.2rem;
  color: #d32f2f;
  margin-bottom: 0.5rem;
  font-weight: bold;
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}

.station .distance {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 0.5rem;
}

.station .date {
  font-size: 0.8rem;
  color: #777;
  margin-bottom: 0.5rem;
}

.station .actions a {
  margin: 0.25rem 0.5rem 0.25rem 0;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  color: #fff;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
}

.icon {
  width: 24px;
  height: 24px;
  /* הצמדת האייקון לימין הכפתור – רווח רק בין האייקון לטקסט */
  margin: 0 0 0 8px;
}

a.waze .icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
}

.station .actions a.waze {
  background: #00d0ff;
}

.station .actions a.maps {
  background: #4285f4;
}

.station .actions a.update {
  background: #8e24aa;
}

.station .actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.station .actions a:hover {
  opacity: 0.9;
}

.station .actions a:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

a.maps .icon {
  background: #fff;
  border-radius: 4px;
}

/* הודעת חיפוש */
#search-notice {
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* תמיכה בניגודיות גבוהה */
body.high-contrast .holiday-greeting {
  color: #fff !important;
  opacity: 1 !important;
}

body.high-contrast #search-notice {
  background: #000 !important;
  color: #0f0 !important;
  border-color: #0f0 !important;
}

body.high-contrast #distanceRange[data-search-active="true"] {
  opacity: 0.3 !important;
}

/* אנימציית נקודות רצות */
.loading-dots::after {
  content: '  .';
  display: inline-block;
  animation: loadingDots 1.4s infinite steps(3, end);
  width: 1.2em;
  text-align: right;
  direction: ltr;
}

@keyframes loadingDots {
  0% {
    content: '  .';
  }
  33% {
    content: ' ..';
  }
  66% {
    content: '...';
  }
}