/* ===== BASE STYLES ===== */
.services-container {
  padding: 5rem 0;
}

/* ===== CRITICAL FIX ===== */
* {
  box-sizing: border-box;
}

/* ===== ADVANCED FILTER STYLES ===== */
.advanced-filter-container {
  margin-bottom: 3rem;
  position: relative;
  z-index: 100;
}

.filter-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  border: 1px solid #eaeaea;
  margin-bottom: 2rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.filter-group {
  position: relative;
  display: flex;
  align-items: center;
  padding-bottom: 0.5rem;
}

.filter-icon {
  margin-right: 0.75rem;
  color: #4CAF50;
  display: flex;
  align-items: center;
}

.filter-input, .filter-select {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  color: #2c3e50;
  outline: none;
  min-width: 0;
  cursor: pointer;
}

.filter-input::placeholder {
  color: #95a5a6;
}

.input-underline {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #ecf0f1;
  transition: all 0.3s ease;
}

.filter-group:focus-within .input-underline {
  background: #4CAF50;
  height: 2px;
}

.select-group {
  position: relative;
}

.select-arrow {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #7f8c8d;
}

/* ===== CUSTOM MULTISELECT STYLES ===== */
.custom-multiselect {
  position: relative;
  flex: 1;
}

.selected-regions {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 0.5rem;
  align-items: center;
  height: 100%;
  padding: 0.25rem 0;
  scrollbar-width: thin;
  max-width: 300px;
  cursor: pointer;
  min-height: 40px;
}

.selected-regions::-webkit-scrollbar {
  height: 4px;
}

.selected-regions::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 2px;
}

.region-tag {
  background-color: #4CAF50;
  color: white;
  border-radius: 16px;
  padding: 4px 12px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  height: 32px;
  flex-shrink: 0;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 5px rgba(221, 135, 43, 0.2);
}

.region-tag-remove {
  margin-left: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.region-tag-remove:hover {
  opacity: 1;
}

.placeholder {
  color: #95a5a6;
  font-size: 0.95rem;
  white-space: nowrap;
}

/* ===== DROPDOWN STYLES - FIXED ===== */
.regions-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #eaeaea;
  border-radius: 8px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  display: none;
  max-height: 350px;
  overflow-y: auto;
  margin-top: 5px;
}

.regions-dropdown.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

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

.search-regions {
  padding: 0.75rem;
  border-bottom: 1px solid #f1f1f1;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.search-regions input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #eaeaea;
  border-radius: 6px;
  outline: none;
  font-size: 0.95rem;
  transition: border-color 0.3s;
}

.search-regions input:focus {
  border-color: #4CAF50;
}

.regions-list {
  padding: 0.5rem 0;
}

.region-option {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s;
  border-bottom: 1px solid #f8f9fa;
}

.region-option:hover {
  background-color: #f0f7ff;
}

.region-option:last-child {
  border-bottom: none;
}

.region-option input {
  margin-right: 0.75rem;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.region-option label {
  cursor: pointer;
  flex: 1;
  color: #2c3e50;
  font-size: 0.95rem;
}

/* ===== SERVICES GRID ===== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0 3rem 0;
  position: relative;
  z-index: 1;
}

.website-link {
  color: #4CAF50;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  border-bottom: 1px dashed #4CAF50;
  padding-bottom: 1px;
}

.website-link:hover {
  color: #4CAF50;
  border-bottom-color: #4CAF50;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
  position: relative;
}

.service-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  position: relative;
}

.container {
  max-width: 1800px;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.service-image {
  height: 160px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.service-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.9);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #4CAF50;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.service-count-badge {
  top: 3rem;
}

.service-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.service-card:hover .service-overlay {
  opacity: 1;
}

.service-view-btn {
  background: #4CAF50;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.service-view-btn:hover {
  background: #4CAF50;
  transform: translateY(-2px);
}

.service-card-content {
  padding: 1.25rem;
}

.service-card-content h3 {
  margin: 0 0 0.75rem;
  color: #2c3e50;
  font-size: 1.1rem;
  font-weight: 600;
}

/* Two-column layout for service meta */
.service-meta-container {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.service-meta-column {
  flex: 1;
  min-width: 0;
}

.meta-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: #34495e;
  line-height: 1.4;
}

.meta-icon {
  margin-right: 0.5rem;
  color: #4CAF50;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.service-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f1f1;
  margin-top: 0.5rem;
}

.update-date {
  font-size: 0.8rem;
  color: #7f8c8d;
  display: flex;
  align-items: center;
}

.date-icon {
  margin-right: 0.25rem;
}

.service-link {
  color: #4CAF50;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}

.service-link:hover {
  color: #4CAF50;
} 

.link-arrow {
  margin-left: 0.25rem;
  transition: transform 0.3s ease;
}

.service-link:hover .link-arrow {
  transform: translateX(3px);
}

/* ===== NO RESULTS MESSAGE ===== */
.no-results-message {
  text-align: center;
  padding: 3rem;
  background: #f9f9f9;
  border-radius: 12px;
  display: none;
  grid-column: 1 / -1;
}

.no-results-icon {
  margin-bottom: 1.5rem;
}

.no-results-message h3 {
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.no-results-message p {
  color: #7f8c8d;
}

/* ===== PAGINATION ===== */
.pagination-wrapper {
  margin-top: 3rem;
  grid-column: 1 / -1;
}

/* ===== SCROLLBAR STYLES ===== */
.regions-dropdown::-webkit-scrollbar {
  width: 6px;
}

.regions-dropdown::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.regions-dropdown::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.regions-dropdown::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* ===== RESPONSIVE STYLES - CRITICAL FIX ===== */

/* Tablet */
@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  }
  
  .filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

/* Mobile Large - CRITICAL FIX FOR DROPDOWN */
@media (max-width: 768px) {
  .filter-grid {
    grid-template-columns: 1fr;
  }
  
  .services-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    margin-top: 1.5rem;
  }
  
  .service-meta-container {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
  
  .service-image {
    height: 140px;
  }
  
  /* MOBILE DROPDOWN - FIXED TO INPUT */
  .custom-multiselect {
    z-index: 1001;
  }
  
  .regions-dropdown {
    position: fixed !important;
    top: auto !important;
    bottom: auto !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-height: 60vh !important;
    z-index: 99999 !important;
    margin-top: 0 !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
    border-radius: 0 0 8px 8px !important;
    border-top: none !important;
  }
  
  /* Position will be set by JavaScript */
  .regions-dropdown.active {
    display: block;
  }
  
  .selected-regions {
    max-width: 100%;
  }
}

/* Mobile Small */
@media (max-width: 576px) {
  .services-container {
    padding: 3rem 0;
  }
  
  .filter-card {
    padding: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
  }
  
  .service-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .region-tag {
    max-width: 100px;
    font-size: 0.7rem;
  }
  
  .service-image {
    height: 120px;
  }
  
  .meta-item {
    font-size: 0.8rem;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
  
  /* Small screen dropdown adjustments */
  .regions-dropdown {
    max-height: 50vh !important;
  }
}

/* Extra Small */
@media (max-width: 480px) {
  .container {
    padding: 0 0.75rem;
  }
  
  .service-card-content {
    padding: 1rem;
  }
  
  .regions-dropdown {
    max-height: 45vh !important;
  }
}

/* Height-based adjustments for dropdown */
@media (max-height: 600px) {
  .regions-dropdown {
    max-height: 45vh !important;
  }
}