/**
 * Styling for Views Exposed Forms
 */

/* General form styling */
/* .views-exposed-form {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  font-size: 0.875rem;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 1.25rem;
} */

/* Form items layout */
/* .views-exposed-form .form-item {
  margin-bottom: 0;
  flex: 1 1 auto;
  min-width: 0;
} */

/* Labels styling */
.views-exposed-form label {
  font-weight: 500;
  margin-bottom: 0;
  color: #333;
  font-size: 1rem;
}

/* Hide fieldset legends visually but keep them accessible */
.views-exposed-form fieldset legend {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Text inputs styling */
.views-exposed-form input.form-text {
  padding: 0.6rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  width: 100%;
  background-color: white;
  font-size: 0.8125rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.views-exposed-form input.form-text:focus {
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
  outline: 0;
}

/* Select inputs styling */
.views-exposed-form select.form-select {
  padding: 0.6rem 1.2rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  width: 100%;
  background-color: white;
  appearance: none;
  font-size: 1rem;
  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='%23333' 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 0.75rem center;
  background-size: 14px;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.views-exposed-form select.form-select:focus {
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
  outline: 0;
}

/* Submit button styling - pill style */
.aggelies-search-form .form-submit,
.views-exposed-form .form-actions .form-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.4rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid #003068;
  background-color: #003068;
  color: white;
  cursor: pointer;
  user-select: none;
}

.aggelies-search-form .form-submit:hover,
.views-exposed-form .form-actions .form-submit:hover {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
}

.dark .aggelies-search-form .form-submit,
.dark .views-exposed-form .form-actions .form-submit {
  border-color: #3b82f6;
  background-color: #3b82f6;
  color: white;
}

.dark .aggelies-search-form .form-submit:hover,
.dark .views-exposed-form .form-actions .form-submit:hover {
  background-color: #003068;
  border-color: #003068;
}

form fieldset.form-wrapper {
   padding: 0!important;
 }

.views-exposed-form #edit-submit-arheio {
  background-color: #003068;
}

.views-exposed-form #edit-submit-arheio:hover {
  background-color: #002552;
}

.views-exposed-form #edit-submit-arheio:hover {
  background-color: #002552;
}

.views-exposed-form #edit-reset {
  background-color: #e5e7eb;
  color: #1f2937;
}

.views-exposed-form #edit-reset:hover {
  background-color: #d1d5db;
}

/* Responsive adjustment for small screens */
@media (max-width: 767px) {
  .views-exposed-form {
    flex-direction: column;
    flex-wrap: wrap !important;
    align-items: stretch;
  }

  .views-exposed-form .form-item,
  .views-exposed-form .form-actions {
    width: 100%;
  }
}

/* Dark mode support */
.tw-dark .views-exposed-form {
  background: #2b3035;
}

.tw-dark .views-exposed-form label {
  color: #e6e6e6;
}

.tw-dark .views-exposed-form input.form-text,
.tw-dark .views-exposed-form select.form-select {
  background-color: #212529;
  border-color: #495057;
  color: #e6e6e6;
}

.tw-dark .views-exposed-form input.form-text:focus,
.tw-dark .views-exposed-form select.form-select:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.tw-dark .views-exposed-form .form-submit {
  background-color: #0d6efd;
}

.tw-dark .views-exposed-form .form-submit:hover {
  background-color: #0a58ca;
}

/* Aggelies Search Card Styling */
.aggelia-card {
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .aggelia-card.aggelia-card--horizontal {
    flex-direction: row;
  }
}

.aggelia-card-image-container {
  width: 100%;
  height: 250px;
  flex-shrink: 0;
  overflow: hidden;
}

@media (min-width: 768px) {
  .aggelia-card-image-container {
    width: 250px;
  }
}

.aggelia-card-image-container img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
}

.aggelia-card-body {
  flex: 1;
  min-width: 0;
}

.aggelia-card-body .views-field {
  margin-bottom: 0.5rem;
}

.aggelia-card-body .views-field-body p {
  margin: 0;
  line-height: 1.6;
}

/* Make sure fields display inline in the card */
.aggelia-card .views-field-field-image {
  display: block;
}

.aggelia-card .views-field-body {
  display: block;
}

/* Pill checkbox styling for aggelies category filter */
.aggelia-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 1.4rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid #d1d5db;
  background-color: white;
  color: #374151;
  cursor: pointer;
  user-select: none;
  margin: 0;
}

.aggelia-pill:hover {
  background-color: #f3f4f6;
}

.aggelia-pill.aggelia-pill--active {
  background-color: #003068;
  border-color: #003068;
  color: white;
}

.aggelia-pill:focus {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
  outline: none;
}

.dark .aggelia-pill {
  border-color: #4b5563;
  background-color: #1f2937;
  color: #d1d5db;
}

.dark .aggelia-pill:hover {
  background-color: #374151;
}

.dark .aggelia-pill.aggelia-pill--active {
  background-color: #003068;
  border-color: #003068;
  color: white;
}

/* Hide original elements in containers processed by aggelies-pills.js */
.aggelies-pills-processed input[type="checkbox"],
.aggelies-pills-processed label:not(.aggelia-pill) {
  display: none !important;
}

/* Ensure the pills themselves are visible and styled correctly */
.aggelies-pills-processed label:hover {
  background-color: #f3f4f6;
}

.dark .aggelies-pills-processed label {
  border-color: #4b5563;
  background-color: #1f2937;
  color: #d1d5db;
}

.dark .aggelies-pills-processed label:hover {
  background-color: #374151;
}

/* Checked state - checkbox covers entire pill area */
.aggelies-pills-processed input[type="checkbox"]:checked ~ label,
.aggelies-pills-processed input[type="checkbox"]:checked + .tw-flex-1 > label {
  background-color: #003068;
  border-color: #003068;
  color: white;
}

.aggelies-pills-processed input[type="checkbox"]:focus ~ label,
.aggelies-pills-processed input[type="checkbox"]:focus + .tw-flex-1 > label {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}
