:root {
  --color-seablue: #094880;
  --text-primary: #303030;
  --text-secondary: #595959;
  --text-tertiary: #666666;
}

* {
  box-sizing: border-box;
}

.resource-results {
  display: flex;
}

.resource-results__sidebar {
  background-color: #F9F9F9;
  padding: 40px 40px 40px 80px;
  max-width: 375px;
  flex: 0 0 auto;
  width: 20%;
}

.resource-results__content {
  background-color: #ffffff;
  padding: 40px 80px 40px 40px;
  flex: 1;
}

.resource-results__content .page-numbers {
  text-align: left;
}

.resource-results__sidebar .mkdf-tours-type-filter-item {
  margin-bottom: 0;
}

.resource-results__sidebar .olp-accordion-item.open {
  margin-bottom: 16px;
}

.resource-results__sidebar .olp-accordion-content .mkdf-tours-type-filter-item label {
  display: flex;
  align-items: start;
  gap: 8px;
  padding: 4px;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
}

.resource-results__sidebar .olp-accordion-content .mkdf-tours-type-filter-item label:hover {
  background-color: #f1f1f1;
  color: var(--text-primary);
}

.resource-results__sidebar .olp-accordion-content .mkdf-tours-type-filter-item label:active {
  outline: 1px dotted var(--text-primary);
  outline-offset: 2px;
}

.resource-results__sidebar .olp-accordion-content .mkdf-tours-type-filter-item label:hover input[type="checkbox"] {
  border-color: var(--text-primary);
}

.resource-results__sidebar .mkdf-tours-type-filter-item label span {
  display: block;
  line-height: 1.3;
}

.resource-results__sidebar .mkdf-tours-type-filter-item label input[type="checkbox"] {
  margin: 0;
  appearance: none;
  border: 1px solid var(--text-secondary);
  height: 20px;
  width: 20px;
	flex-shrink: 0;
}

.resource-results__sidebar .mkdf-tours-type-filter-item label input[type="checkbox"]:not(:disabled):checked {
  border-color: var(--color-seablue) !important;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20" viewBox="0 0 32 32" xml:space="preserve"><path style="fill: %23ffffff" d="M11.941,28.877l-11.941-11.942l5.695-5.696l6.246,6.246l14.364-14.364L32,8.818"/></svg>');
  background-color: var(--color-seablue);
  background-size: 12px;
  background-position: center center;
  background-repeat: no-repeat;
}

.resource-results__sidebar .olp-accordion-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
	padding: 4px;
}

.resource-results__sidebar .olp-accordion-header-text {
  color: var(--text-primary);
}

.resource-results__sidebar .filter-search {
  margin-bottom: 16px;
}

.resource-results__sidebar .filter-search label {
  color: var(--text-primary);
  font-weight: bold;
  font-size: 16px;
  display: block;
  margin-bottom: 4px;
}

.resource-results__sidebar .filter-search .form-field {
  display: flex;
}

.resource-results__sidebar .filter-search .form-field input {
  height: 36px;
  font-size: 16px;
  color: var(--text-primary);
  border: 1px solid #ddd;
  padding: 4px;
  background-color: #fff;
  flex: 1;
  width: 100%;
}

.resource-results__sidebar .filter-search .form-field input:focus {
  border-color: var(--color-seablue);
}

.resource-results__sidebar .filter-search .form-field button {
  border: none;
  background-color: var(--color-seablue);
  border-radius: 0;
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.results-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  /* left column for image, right for text */
  gap: 24px;
  /* space between image and text */
  align-items: start;
  /* align items at the top */
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid #DDDDDD;
}

.results-item__img {
  width: 100%;
  height: 100%;
}

.results-item__img-link {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
}

.results-item__img-link::before {
  content: '';
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  background: var(--color-seablue);
  top: 0;
  left: 0;
  z-index: 1;
  opacity: .0;
}

.results-item__img-link:hover::before {
  opacity: .2
}

.results-item__img img {
  object-fit: cover;
  width: 100%;
  height: 100%;
  display: block;
  position: absolute;
}


.result-item__title {
  margin-top: 0;
  margin-bottom: 8px;
}

.result-item__title a:hover {
  text-decoration: underline;
  color: var(--color-seablue);
}


.results-item__text {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.results-item__desc {
  display: -webkit-box;
  /* Required for line clamping */
  -webkit-box-orient: vertical;
  /* Set vertical flow */
  -webkit-line-clamp: 3;
  /* Number of lines before cutoff */
  overflow: hidden;
  /* Hide overflowed text */
  text-overflow: ellipsis;
  /* Add "..." at the end */
  line-height: 1.4;
  margin-bottom: 32px;
}

.results-item__buttons .results-item__btn-outline {
  display: inline-flex;
  line-height: 1;
  padding: 8px 16px;
  border: 1px solid var(--color-seablue);
  color: var(--color-seablue);
  font-weight: 600;
  background: transparent;
}

.results-item__buttons .results-item__btn-outline:hover {
  background: rgba(9, 72, 128, 0.05);
}

.results-item__buttons .results-item__btn-outline:active {
  background: rgba(9, 72, 128, 0.1);
  outline: 1px dotted var(--color-seablue);
  outline-offset: 2px;
}

.results-item__buttons .results-item__btn-fill {
  display: inline-flex;
  line-height: 1;
  padding: 8px 16px;
  background-color: var(--color-seablue);
  color: #ffffff;
  font-weight: 600;
  border: 1px solid var(--color-seablue);
}

.results-item__buttons .results-item__btn-fill:hover {
  background: #0C60AC;
}

.results-item__buttons .results-item__btn-fill:active {
  background-color: #073966;
  outline: 1px dotted var(--color-seablue);
  outline-offset: 2px;
}

.results-item__text-bot {
  display: flex;
  /* justify-content: space-between; */
}

.results-item__categories {
  display: flex;
}

.results-item__categories>div {
  padding-right: 24px;
  margin-right: 24px;
  border-right: 1px solid #ddd;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.3;
}

.results-item__categories strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 4px;
}

.results-item__categories span {
  display: block;
  margin-bottom: 4px;
  color: var(--text-secondary);
}

.results-item__buttons {
  display: flex;
  align-items: center;
}


/* Results header with count and chips */
.results-header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

/* Refined by section */
.refined-by-section {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 15px;
}

.refined-by-label {
  color: #666;
  font-size: 14px;
  margin-top: 6px;
  flex-shrink: 0;
}

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

/* Filter chip styles */
.filter-chip {
  display: inline-flex;
  align-items: center;
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 0;
  padding: 6px 12px 6px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  gap: 8px;
  transition: all 0.2s ease;
}

.filter-chip:hover {
  background: #f1f1f1;
  border-color: #cccccc;
}

.remove-chip {
  background: none;
  border: none;
  color: #6c757d;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.remove-chip:hover {
  background: #dc3545;
  color: white;
}

/* Responsive design for chips */
@media (max-width: 768px) {
  .refined-by-section {
    flex-direction: column;
    gap: 10px;
  }

  .refined-by-label {
    margin-top: 0;
  }

  .results-count {
    font-size: 20px;
  }
}

/* Loading styles for AJAX filtering */
.resources-results__list.loading .results-item{
  opacity: 0.1;
  pointer-events: none;
  position: relative;
}

.loading-spinner {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.5);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 100;
  backdrop-filter: blur(4px);
  text-align: center;
}

.loading-spinner p {
  margin: 4px 0 0 0;
  font-weight: bold;
  color: var(--text-primary);
  font-size: 20px;
  line-height: 24px !important;
}

.loading-spinner span {
  font-size: 16px;
  color: var(--text-tertiary);
  display: block;
}
/* Optional: Add spinner animation */
.loading-spinner::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--color-seablue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 10px;
  vertical-align: middle;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Filter styling improvements */
.filter-actions {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.clear-filters {
  font-size: 16px;
  font-weight: bold;
  color: var(--color-seablue);
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
}

.clear-filters:hover {
  color: #0C60AC;
}

/* Results info styling */
.results-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #eee;
  margin-bottom: 20px;
}

.results-count {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 0;
  margin-top: 0;
}

/* Smooth transitions for filter changes */
.resources-results__list {
  transition: opacity 0.3s ease;
  position: relative;
}

/* Disabled state for filters during loading */
.resources-results__filter.loading input[type="checkbox"] {
  pointer-events: none;
  opacity: 0.6;
}

/* Pagination improvements */
.mkdf-blog-pagination {
  margin-top: 40px;
}

.mkdf-blog-pagination a {
  transition: all 0.2s ease;
}

.results-header__filter-toggle,
.resources-results__filter-close {
  display: none;
}


@media (max-width: 1280px) {
  .resource-results__sidebar,
  .resource-results__cont {
    padding: 40px;
  }
  .resource-results__sidebar .mkdf-tours-type-filter-item label input[type="checkbox"] {
    flex-shrink: 0;
  }
}

@media (max-width: 1190px) {
  .resource-results__sidebar {
    width: 25%;
  }

  .results-item {
    grid-template-columns: 150px 1fr;
  }

  .resource-results__content {
    padding-right: 40px;
  }

  .results-item__buttons .results-item__btn-outline {
    white-space: nowrap;
  }

  .results-item__categories > div {
    flex: 1;
  }
}

@media (max-width: 1024px) {
  .resource-results {
    flex-direction: column;
  }

  .resource-results__sidebar {
    width: 100%;
    max-width: none;
    padding: 40px;
    display: none;
  }

  .results-header {
    display: flex;
    justify-content: space-between;
    padding-top: 20px;
    align-items: center;
  }

  .results-count {
    font-size: 20px;
  }

  .results-header__filter-toggle {
    display: inline-flex;
    line-height: 1;
    padding: 5px 12px;
    border: 1px solid var(--text-primary);
    color: var(--text-primary);
    font-weight: 600;
    background: transparent;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    cursor: pointer;
    cursor: pointer;
  }

  .results-header__filter-toggle:hover {
    background: #f1f1f1;
  }

  .results-header__filter-toggle:active {
    background: #eee;
    outline: 1px dotted var(--color-seablue);
    outline-offset: 2px;
  }

  .resource-results__content {
    padding-top: 0;
  }

  .results-item {
    grid-template-columns: 200px 1fr;
  }

  body.filters-open {
    overflow: hidden;
  }

  body.filters-open .resource-results__sidebar {
    padding: 0;
    position: fixed;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,.8);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: block;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
  }

  body.filters-open .resources-results__filter {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 90%;
    background-color: #f9f9f9;
    backdrop-filter: blur(4px);
    z-index: 9999;
    padding: 40px;
    overflow-y: auto;
  }

  body.filters-open .mkdf-mobile-header,
  body.filters-open .mkdf-page-footer {
    z-index: 1;
  }

  .resources-results__filter-close {
    display: block;
  }

  .resources-results__filter-close {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    border-radius: 0;
    border: navajowhite;
    padding: 11px;
    background: #eee;
    cursor: pointer;
  }
}

/* Responsive improvements */
@media (max-width: 768px) {
  .loading-spinner {
    padding: 15px;
    font-size: 14px;
  }

  .filter-actions {
    text-align: center;
  }

  .results-info {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  body.filters-open .resources-results__filter {
    padding: 40px 24px;
  }

  .resource-results__content {
    padding-left: 20px;
    padding-right: 20px;
  }

  .results-count {
    font-size: 16px;
  }

  .results-header__filter-toggle {
    font-size: 14px;
    padding: 5px 6px;
  }

  .results-item {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 16px;
  }

  .results-item__img {
    height: 150px;
  }

  .results-item__text-bot {
    flex-direction: column;
  }

  .results-item__categories {
    flex-direction: column;
    margin-bottom: 16px;
  }

  .results-item__desc {
    margin-bottom: 24px;
    font-size: 14px;
  }

  .result-item__title {
    font-size: 16px;
  }

  .results-item__categories > div {
    border-right: none;
    padding: 0;
    margin: 0 0 8px 0;
  }
  .results-item__buttons a{
    font-size: 14px;
  }
}