/* Modern Search and Filter Styles */

/* Search Section Compact */
.search-section-compact {
  padding: 15px 0;
  background-color: #fff;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-container-compact {
  width: 100%;
}

.search-header {
  margin-bottom: 15px;
}

.search-title {
  font-size: 24px;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.search-hero {
  width: 100%;
}

.search-box {
  display: flex;
  align-items: center;
  background-color: #f5f7fa;
  border-radius: 50px;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid #e0e0e0;
}

.search-box:focus-within {
  box-shadow: 0 4px 15px rgba(92, 56, 144, 0.15);
  border-color: #5C3890;
  background-color: #fff;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 20px;
  color: #5C3890;
  font-size: 16px;
  z-index: 1;
}

.search-input {
  width: 100%;
  height: 50px;
  padding: 0 20px 0 45px;
  border: none;
  font-size: 15px;
  color: #333;
  background: transparent;
  outline: none;
}

.search-clear {
  background: transparent;
  border: none;
  color: #aaa;
  font-size: 16px;
  padding: 0 15px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s ease;
}

.search-clear.visible {
  opacity: 1;
}

.search-clear:hover {
  color: #5C3890;
}

.search-button {
  height: 50px;
  padding: 0 25px;
  background-color: #5C3890;
  color: white;
  border: none;
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.search-button:hover {
  background-color: #4a2e76;
}

/* Search Progress Bar */
.search-progress-bar {
  height: 3px;
  width: 100%;
  background-color: transparent;
  position: relative;
  overflow: hidden;
  margin-top: 5px;
  border-radius: 3px;
}

.search-progress-bar::before {
  content: '';
  position: absolute;
  height: 100%;
  width: 0;
  background-color: #5C3890;
  transition: width 0.3s ease;
  border-radius: 3px;
}

.search-progress-bar.active::before {
  animation: progress-animation 1s infinite ease-in-out;
}

@keyframes progress-animation {
  0% {
    width: 0;
    left: 0;
  }
  50% {
    width: 70%;
    left: 15%;
  }
  100% {
    width: 0;
    left: 100%;
  }
}

/* Filters Container */
.filters-container {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  padding: 0;
  margin-bottom: 20px;
  position: sticky;
  top: 95px;
  max-height: calc(100vh - 95px);
  overflow-y: auto;
  border: 1px solid #f0f0f0;
}

.filters-title {
  margin-bottom: 0;
  background: linear-gradient(135deg, #5C3890 0%, #7b4db8 100%);
  padding: 15px 20px;
  border-radius: 12px 12px 0 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.filters-title h4 {
  font-size: 18px;
  font-weight: 600;
  color: white;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filters-title h4 i {
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.filters-title h4 i:hover {
  transform: rotate(180deg);
}

.filters-content {
  padding: 20px;
}

.filter-group {
  margin-bottom: 20px;
  background-color: #f9f9f9;
  border-radius: 8px;
  padding: 15px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.filter-group:hover {
  background-color: #f5f0ff;
  border-color: #e0d5f5;
  box-shadow: 0 2px 8px rgba(92, 56, 144, 0.1);
}

.filter-group-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #5C3890;
  display: flex;
  align-items: center;
}

.filter-group-title i {
  margin-right: 8px;
  font-size: 14px;
  opacity: 0.8;
}

/* Filter Control Styles */
.filter-control {
  width: 100%;
  height: 45px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  padding: 0 15px;
  font-size: 14px;
  color: #333;
  appearance: none;
  background-color: white;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235C3890' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.filter-control:focus {
  outline: none;
  border-color: #5C3890;
  box-shadow: 0 0 0 3px rgba(92, 56, 144, 0.15);
}

.filter-control:hover {
  border-color: #5C3890;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-check {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
}

.form-check-input {
  margin-right: 8px;
  cursor: pointer;
}

.form-check-label {
  cursor: pointer;
  font-size: 14px;
}

/* Active Filters */
.active-filters-container {
  margin-top: 20px;
  background-color: #f5f0ff;
  border-radius: 8px;
  padding: 15px;
  border: 1px solid #e0d5f5;
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-tag {
  background-color: white;
  border: 1px solid #5C3890;
  color: #5C3890;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.filter-tag:hover {
  background-color: #f0e6ff;
  transform: translateY(-2px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.filter-tag .remove-tag {
  cursor: pointer;
  font-size: 14px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(92, 56, 144, 0.1);
  transition: all 0.3s ease;
}

.filter-tag .remove-tag:hover {
  color: white;
  background-color: #ff6b6b;
}

/* Reset Filters Button */
.reset-filters {
  margin-top: 15px;
  width: 100%;
  padding: 10px;
  border: none;
  background-color: #f0e6ff;
  color: #5C3890;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.reset-filters:hover {
  background-color: #5C3890;
  color: white;
}

.reset-filters i {
  font-size: 14px;
}

/* Schools List Header */
.schools-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px;
  border-radius: 8px;
  background-color: #f9f9f9;
  border: 1px solid #e0e0e0;
}

.result-number h4 {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.view-toggle {
  display: flex;
  gap: 8px;
}

.view-toggle .btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: white;
  border: 1px solid #ddd;
  color: #777;
  transition: all 0.3s ease;
}

.view-toggle .btn.active {
  background: #5C3890;
  color: white;
  border-color: #5C3890;
}

/* Ad Card Styles */
.ad-card {
  margin-bottom: 30px;
  animation: fadeIn 0.5s ease forwards;
}

.ad-card-inner {
  border: none;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  height: 100%;
}

.ad-card-inner:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.ad-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 240px;
  transition: transform 0.5s ease;
}

.ad-card-inner:hover .ad-image {
  transform: scale(1.05);
}

/* Responsive styles */
@media (max-width: 992px) {
  .search-container-compact {
    max-width: 100%;
  }
  
  .filters-container {
    position: relative;
    top: 0;
    max-height: none;
    overflow-y: visible;
  }
}

@media (max-width: 768px) {
  .search-box {
    flex-direction: column;
    border-radius: 8px;
  }
  
  .search-input-wrapper {
    width: 100%;
    border-bottom: 1px solid #eee;
  }
  
  .search-button {
    width: 100%;
    border-radius: 0 0 8px 8px;
  }
}