/* Events Filter Block - Single Row Layout */
.events-filter-wrapper {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* Filter Labels */
.filter-label {
  font-weight: bold;
  font-size: 13px;
  margin-bottom: 4px;
  color: #333;
  display: block;
}

/* Event Type Dropdown */
.filter-event-type {
  flex: 0 1 200px;
}

.select-wrapper {
  position: relative;
  width: 100%;
}

.filter-event-type select {
  width: 100%;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 0.9rem;
  background-color: white;
  cursor: pointer;
  appearance: none;
}

.select-arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Date Dropdown */
.filter-dates {
  flex: 0 1 200px;
  position: relative;
}

.date-dropdown {
  position: relative;
  width: 100%;
}

.date-dropdown-toggle {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 0.9rem;
}

.date-dropdown-toggle:hover {
  background: #f8f9fa;
}

.date-dropdown-toggle[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-arrow {
  transition: transform 0.2s;
}

.date-label {
  flex: 1;
  text-align: left;
}

.date-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  z-index: 1000;
  min-width: 200px;
}

.date-dropdown-menu.show {
  display: block;
}

.date-option {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  text-align: left;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.date-option:hover {
  background: #f8f9fa;
}

.date-option.active {
  background: #007bff;
  color: white;
}

.date-custom-toggle {
  border-top: 1px solid #dee2e6;
  padding: 0;
}

.custom-range-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  text-align: left;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.9rem;
}

.custom-range-btn:hover {
  background: #f8f9fa;
}

/* Custom Date Picker Modal */
.custom-date-picker-modal {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
  z-index: 1001;
  padding: 1.25rem;
  min-width: 340px;
}

.custom-date-picker-modal.show {
  display: block;
}

.date-picker-container {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.date-picker-column {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.date-picker-column label {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  color: #495057;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.date-picker-column input[type="date"] {
  padding: 0.5rem;
  border: 2px solid #dee2e6;
  border-radius: 4px;
  font-size: 0.95rem;
  width: 100%;
  cursor: pointer;
}

.date-picker-column input[type="date"]:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.date-picker-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-top: 0.75rem;
  border-top: 1px solid #dee2e6;
}

/*
.btn-date-done,
.btn-date-cancel {
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: 0;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-date-done {
  background: #d32f2f;
  color: white;
}

.btn-date-done:hover {
  background: #0056b3;
}

.btn-date-cancel {
  background: #6c757d;
  color: white;
}

.btn-date-cancel:hover {
  background: #545b62;
}
*/

/* State Selector */
.filter-state {
  flex: 0 1 150px;
}

.filter-state select {
  width: 100%;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 0.9rem;
  background-color: white;
  cursor: pointer;
  appearance: none;
}
/*
.filter-state select {
  width: 100%;
  padding: 0.5rem 0.25rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 0.9rem;
  background-color: white;
  cursor: pointer;
}
*/

/* City Input */
.filter-city {
  flex: 0 1 200px;
}

.filter-city input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 0.9rem;
}

/* Free Events Checkbox */
.filter-free {
  flex: 0 0 auto;
  align-self: flex-end; /* Align to bottom since no label */
  line-height: 40px;
}

.free-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.9rem;
  white-space: nowrap;
  padding-top: 4px; /* Add some padding to align better */
}

.free-checkbox input {
  margin-right: 0.5rem;
  cursor: pointer;
}

/* Action Buttons */
.filter-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
  align-self: flex-end; /* Align to bottom since no label */
}

.btn-icon {
  font-size: 12px;
  width: auto;
  height: 36px;
  padding: 0 9px;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: #f8f9fa;
  transform: translateY(-1px);
}

.events-filter-apply {
  color: #007bff;
}

.events-filter-apply:hover {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

.events-filter-reset {
  color: #6c757d;
}

.events-filter-reset:hover {
  background: #6c757d;
  color: white;
  border-color: #6c757d;
}

/* Hide the original Views exposed form */
.events-exposed-form-original {
  display: block !important;
}

/* Loading State */
.events-filter-wrapper.loading {
  position: relative;
  opacity: 0.6;
  pointer-events: none;
}

.events-filter-wrapper.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 992px) {
  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-item {
    width: 100%;
  }
  
  .filter-event-type,
  .filter-dates,
  .filter-state,
  .filter-city {
    flex: 1 1 100%;
  }
  
  .filter-actions {
    margin-left: 0;
    justify-content: center;
    margin-top: 0.5rem;
  }
}

@media (min-width: 993px) and (max-width: 1200px) {
  .filter-row {
    flex-wrap: wrap;
  }
  
  .filter-event-type {
    flex: 0 1 180px;
  }
  
  .filter-dates {
    flex: 0 1 130px;
  }
}