/* Menu Search Icon */
.tsacf-menu-search-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: inherit;
}

.tsacf-menu-search-icon:hover {
  opacity: 0.8;
  transform: scale(1.1);
}

.tsacf-menu-search-icon svg {
  width: 20px;
  height: 20px;
}

/* Modal Styles */
.tsacf-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tsacf-modal.active {
  display: flex;
  opacity: 1;
}

.tsacf-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(34, 31, 84, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

.tsacf-modal-content {
  position: relative;
  width: 95%;
  max-width: 900px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.tsacf-modal.active .tsacf-modal-content {
  transform: translateY(0);
}

.tsacf-modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #f0f0f7;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #ffffff;
}

.tsacf-modal-search-input {
  flex: 1;
  font-size: 1.5rem;
  border: none;
  outline: none;
  padding: 0.5rem 0;
  font-family: inherit;
  color: #221F54;
  font-weight: 500;
}

.tsacf-modal-search-input::placeholder {
  color: #bcc2d8;
}

.tsacf-modal-close {
  background: #f4f5f9;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6a6f8a;
  transition: all 0.2s ease;
  font-size: 1.5rem;
  line-height: 1;
}

.tsacf-modal-close:hover {
  background: #e8e9f2;
  color: #221F54;
  transform: rotate(90deg);
}

.tsacf-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  background: #fbfbfd;
}

.tsacf-modal-results {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.tsacf-modal .tsacf-section-title {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #7259ef;
  font-weight: 700;
  margin-bottom: 1.5rem;
  border: none;
  padding: 0;
}

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

.tsacf-modal .tsacf-hit {
  background: #ffffff;
  border: 1px solid #edf0f5;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tsacf-modal .tsacf-hit:hover {
  transform: translateY(-5px);
  border-color: #7259ef;
  box-shadow: 0 12px 24px -10px rgba(114, 89, 239, 0.2);
}

.tsacf-modal .tsacf-hit-thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: #f4f5f9;
}

.tsacf-modal .tsacf-hit-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tsacf-modal .tsacf-hit-title {
  margin: 0 !important;
  font-size: 1.1rem !important;
  line-height: 1.4 !important;
  font-family: inherit !important;
  text-align: left !important;
}

.tsacf-modal .tsacf-hit-title a {
  color: #221F54 !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  transition: color 0.2s ease !important;
  display: block !important;
  border: none !important;
  padding: 0 !important;
}

.tsacf-modal .tsacf-hit:hover .tsacf-hit-title a {
  color: #7259ef !important;
}

.tsacf-modal .tsacf-hit-excerpt {
  font-size: 0.875rem !important;
  color: #6a6f8a !important;
  line-height: 1.6 !important;
  margin-top: 0.5rem !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-align: left !important;
  font-family: inherit !important;
  font-weight: 0 !important;
}

/* Load More Button */
.tsacf-load-more-wrapper {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
}

.tsacf-load-more {
  background: #ffffff;
  border: 1px solid #7259ef;
  color: #7259ef;
  padding: 0.75rem 2rem;
  border-radius: 99px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tsacf-load-more:hover {
  background: #7259ef;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(114, 89, 239, 0.3);
}

.tsacf-load-more.loading {
  pointer-events: none;
  opacity: 0.7;
}

.tsacf-load-more.loading::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Loading State */
.tsacf-modal-loading-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem;
  gap: 1rem;
}

.tsacf-modal-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f0f0f7;
  border-top-color: #7259ef;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* List View Styles */
.tsacf-grid.tsacf-list-view {
  display: flex !important;
  flex-direction: column !important;
  gap: 1rem !important;
}

.tsacf-list-hit {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 1.25rem !important;
  background: rgba(255, 255, 255, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 12px !important;
  transition: all 0.2s ease !important;
}

.tsacf-list-hit:hover {
  background: rgba(255, 255, 255, 0.9) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

.tsacf-list-info {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.25rem !important;
}

.tsacf-list-excerpt {
  font-size: 0.85rem !important;
  color: #6a6f8a !important;
  line-height: 1.5 !important;
  margin: 0.25rem 0 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

.tsacf-list-category {
  font-size: 0.75rem !important;
  color: #7259ef !important;
  text-transform: uppercase !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em !important;
}

.tsacf-btn-read {
  background: #7259ef !important;
  color: #ffffff !important;
  text-decoration: none !important;
  padding: 0.6rem 1.5rem !important;
  border-radius: 99px !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
}

.tsacf-btn-read:hover {
  background: #221F54 !important;
  box-shadow: 0 4px 12px rgba(114, 89, 239, 0.3) !important;
}

@media (max-width: 600px) {
  .tsacf-list-hit {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
  }

  .tsacf-list-action {
    width: 100% !important;
  }

  .tsacf-btn-read {
    display: block !important;
    text-align: center !important;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.tsacf-modal .tsacf-noresults {
  text-align: center;
  padding: 4rem 1rem;
  color: #6a6f8a;
}