/* Контейнер для "Інші тести" */
.other-tests-wrapper {
  position: relative;
  max-width: 1400px;
  width: 95%;
  margin: 30px auto;
  padding: 0 10px;
}

/* Добавляем звезды на фон */
.other-tests-wrapper::before {
  content: '✧';
  position: absolute;
  top: 20px;
  left: 10%;
  color: var(--star-color);
  opacity: 0.6;
  font-size: 14px;
  animation: twinkle 3s infinite ease-in-out;
}

.other-tests-wrapper::after {
  content: '✧';
  position: absolute;
  top: 50px;
  right: 15%;
  color: var(--star-color);
  opacity: 0.4;
  font-size: 12px;
  animation: twinkle 2.5s infinite ease-in-out 0.5s;
}

.other-tests-wrapper h2 {
  text-align: center;
  font-size: 28px;
  color: var(--text-primary);
  margin-bottom: 25px;
  position: relative;
  padding-bottom: 15px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.other-tests-wrapper h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--accent-color);
  border-radius: 2px;
}

.other-tests-wrapper .tests-count {
  color: var(--accent-color);
  font-weight: bold;
}

.other-tests {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 15px;
}

/* Используем стили карточек категорий для блока "Інші тести" */
.other-tests.cat-tests-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* Убеждаемся, что размер заголовков такой же, как на странице категорий */
.other-tests.cat-tests-grid .cat-test-title {
  font-size: 18px !important;
  font-weight: 700;
}

@media (max-width: 1200px) {
  .other-tests.cat-tests-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .other-tests.cat-tests-grid {
    grid-template-columns: 1fr;
  }
}

.test-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: var(--surface-dark);
  border: 1px solid var(--divider-color);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.test-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-color);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.6);
}

.test-card:hover .btn {
  background: var(--button-hover);
}

.test-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 0;
  margin: 0;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  position: relative;
}

/* Обертка для изображения */
.image-wrapper {
  position: relative;
  width: 100%;
  flex-shrink: 0;
}

.test-card:hover img {
  transform: scale(1.05);
}

.test-card .content-wrapper {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: 15px;
  background: var(--card-gradient);
}

.test-card .text-content {
  flex-grow: 1;
  margin-bottom: 15px;
}

.test-card h3 {
  font-size: 16px;
  margin: 0 0 8px 0;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 2.6em;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
}

.test-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 4.2em;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
}

.test-card .btn {
  width: calc(100% - 20px);
  margin: 0 10px 10px;
  padding: 8px 15px;
  text-align: center;
  background: var(--button-primary);
  color: #000000;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  transition: all 0.2s ease;
  align-self: flex-end;
  pointer-events: none;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.test-card:hover .btn {
  background: var(--button-hover);
}

.test-stats {
  display: flex;
  gap: 15px;
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-secondary);
  opacity: 0.8;
}

.views-count, .time {
  display: flex;
  align-items: center;
  gap: 5px;
}

.material-symbols-rounded {
  font-size: 18px;
  font-variation-settings: 'FILL' 1;
  color: var(--accent-color);
}

/* Стили для рейтинга в карточке */
.card-rating {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 5px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 3px;
  z-index: 2;
  pointer-events: none;
}

.card-rating .rating-value {
  color: #ffffff;
  font-weight: 700;
  font-size: 10px;
}

.card-rating .rating-star {
  color: #ffffff;
  font-size: 10px;
}

.card-rating .rating-count {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  margin-left: 2px;
}

/* Добавляем эффект мерцающих звезд */
.test-card::before {
  content: '✧';
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--accent-color);
  opacity: 0.5;
  font-size: 14px;
  animation: twinkle 2s infinite ease-in-out;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
  .other-tests {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .test-card {
    flex-direction: row;
    min-height: 120px;
    height: auto;
  }

  .image-wrapper {
    width: 120px;
    min-height: 100%;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
  }

  .test-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
  }

  .test-card .content-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex-grow: 1;
    padding: 10px;
    min-height: 120px;
    background: var(--surface-dark);
  }

  .test-card .text-content {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    margin-bottom: 8px;
  }

  .test-card h3 {
    margin: 0;
    font-size: 15px;
    line-height: 1.2;
    height: 2.4em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .test-card p {
    margin: 0;
    font-size: 12px;
    line-height: 1.2;
    height: 2.4em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .test-card .btn {
    margin: auto 0 0 0;
    padding: 6px 12px;
    font-size: 12px;
    align-self: flex-start;
    white-space: nowrap;
    flex-shrink: 0;
    width: auto;
  }

  .test-stats {
    font-size: 12px;
    margin: 4px 0;
  }

  .card-rating {
    padding: 2px 4px;
    left: 6px;
    bottom: 6px;
  }
  
  .card-rating .rating-value {
    font-size: 8px;
  }
  
  .card-rating .rating-star {
    width: 8px;
    height: 8px;
  }
  
  .card-rating .rating-star::before,
  .card-rating .rating-star::after {
    font-size: 8px;
  }
  
  .card-rating .rating-count {
    font-size: 7px;
  }

  .material-symbols-rounded {
    font-size: 16px;
  }
}

/* Для очень маленьких экранов */
@media (max-width: 360px) {
  .test-card {
    min-height: 100px;
    height: auto;
  }

  .image-wrapper {
    width: 100px;
    min-height: 100%;
  }

  .test-card .content-wrapper {
    padding: 8px;
    min-height: 100px;
  }

  .test-card h3 {
    font-size: 14px;
  }

  .test-card p {
    font-size: 11px;
  }

  .test-card .btn {
    padding: 4px 10px;
    font-size: 11px;
  }

  .test-stats {
    font-size: 11px;
    margin-top: 2px;
  }

  .card-rating {
    padding: 2px 5px;
    left: 4px;
    bottom: 4px;
  }
  
  .card-rating .rating-value {
    font-size: 13px;
  }
  
  .card-rating .rating-star {
    width: 13px;
    height: 13px;
  }
  
  .card-rating .rating-star::before,
  .card-rating .rating-star::after {
    font-size: 13px;
  }
  
  .card-rating .rating-count {
    font-size: 10px;
  }

  .material-symbols-rounded {
    font-size: 14px;
  }
}

/* Контейнер фильтров */
.filters-container {
  position: relative;
  width: 100%;
  margin: 20px 0;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filters-scroll {
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 5px 0;
}

.filters-scroll::-webkit-scrollbar {
  display: none;
}

.filters-wrapper {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: max-content;
  padding: 0 5px;
  width: max-content;
}

.tags-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}

.tags-filter > *:not(:last-child) {
  margin-right: 12px;
}

/* Общие стили для всех фильтров */
.main-filters {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: nowrap;
  width: max-content;
}

.tags-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}

.tags-filter > *:not(:last-child) {
  margin-right: 12px;
}

/* Общие стили для всех кнопок */
.filter-btn,
.tag-btn,
a.tag-btn {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s ease;
  white-space: nowrap;
  width: auto !important;
  min-width: fit-content;
  flex: 0 0 auto;
  text-decoration: none;
  line-height: 1.4;
}

a.tag-btn:hover {
  text-decoration: none;
  opacity: 0.8;
}

.tag-btn-hash {
  font-weight: 700;
  margin-right: 2px;
  font-size: 14px;
}

.tag-btn-text {
  color: var(--text-primary);
  font-weight: 500;
}

.filter-btn:hover,
.tag-btn:hover {
  background: transparent;
  border: none;
  opacity: 0.8;
}

.filter-btn.active,
.tag-btn.active {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-weight: 500;
  opacity: 1;
}

.filter-btn .material-symbols-rounded {
  font-size: 20px;
  color: var(--accent-color);
  transition: color 0.2s ease;
}

.filter-btn.active .material-symbols-rounded {
  color: #000000;
}

/* Разделитель */
.filters-divider {
  width: 1px;
  height: 24px;
  background: var(--divider-color);
  margin: 0 10px;
  flex-shrink: 0;
}

/* Кнопки прокрутки */
.scroll-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--divider-color);
  border-radius: 4px;
  background: var(--surface-dark);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  z-index: 1;
}

.scroll-btn .material-symbols-rounded {
  font-size: 24px;
  color: var(--accent-color);
  transition: color 0.2s ease;
}

.scroll-btn:hover {
  background: var(--hover-overlay);
  border-color: var(--accent-color);
}

.scroll-btn:active {
  background: var(--button-primary);
  border: none;
  color: #000000;
}

.scroll-btn:active .material-symbols-rounded {
  color: #000000;
}

/* Адаптивность */
@media (max-width: 768px) {
  .filters-container {
    padding: 0 4px;
  }
  
  .scroll-btn {
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 480px) {
  .filters-container {
    padding: 0 2px;
  }
  
  .scroll-btn {
    width: 24px;
    height: 24px;
  }
}

/* Стили для подвала */
.site-footer {
  margin-top: 60px;
  padding: 20px 0;
  background: var(--surface-dark);
  border-top: 1px solid rgba(212, 175, 55, 0.3);
  backdrop-filter: blur(10px);
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-container p {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s ease;
}

.footer-links a:hover {
  color: var(--accent-color);
}

@media (max-width: 768px) {
  .site-footer {
    margin-top: 40px;
    padding: 15px 0;
  }

  .footer-container {
    flex-direction: column;
    gap: 10px;
    text-align: center;
    padding: 0 15px;
  }

  .footer-links {
    gap: 15px;
  }

  .footer-container p,
  .footer-links a {
    font-size: 12px;
  }
}
