/*!
 * DargwaDict — search pages (search by word / by morpheme) and results
 */

.search-page-container {
  padding-top: 150px;
}

/* Начальное состояние блока результатов до первого AJAX-поиска;
   .js-hidden отвечает только за старт, дальше видимостью управляет jQuery.fadeIn() */
.js-hidden {
  display: none;
}

.results-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.results-wrapper-centered {
  float: none;
  margin: 0 auto;
}

/* Виртуальная клавиатура */
.virtual-keyboard button {
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.virtual-keyboard button:active {
  transform: scale(0.95);
  background: #ddd !important;
}

/* Карточка с параметрами поиска */
.search-params-card {
  background-color: #f5f5f5;
  border-radius: 12px;
  padding: 16px 20px;
  margin-top: 40px;
  margin-bottom: 40px;
  overflow-x: auto;
}

.search-params-title {
  margin: 0 0 10px 0;
  font-size: 15px;
  color: #333;
  font-weight: 600;
}

.search-params-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}

.search-param-item {
  background: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  color: #555;
  max-width: calc(50% - 12px);
  word-break: break-word;
  overflow-wrap: break-word;
}

.search-param-item b {
  color: #333;
  margin-right: 6px;
}

.search-param-item span {
  word-break: break-word;
}

/* Контейнер результатов (AJAX) */
.ajax-results-container {
  margin-top: 40px;
  width: 100%;
}

.ajax-results-container > div {
  width: 80%;
  max-width: 100%;
  margin: 0 auto;
}

/* Таблица результатов */
.results-table {
  width: 100%;
  margin-bottom: 80px;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.results-table thead tr:first-child {
  background-color: #4dadb0;
  color: white;
}

.results-table thead tr:first-child th {
  padding: 12px 15px;
  font-weight: 600;
  border-bottom: none;
}

.results-table thead tr:last-child {
  background-color: #f5f5f5;
  border-bottom: 2px solid #4dadb0;
}

.results-table thead tr:last-child th {
  padding: 10px 15px;
  font-weight: 600;
  color: #333;
}

.results-table tbody tr:hover {
  background-color: #f9f9f9;
}

.results-table tbody td {
  padding: 10px 15px;
  vertical-align: middle;
  border-top: 1px solid #eee;
}

.results-table a {
  color: #3d8a8c;
  font-weight: bolder;
  text-decoration: none;
}

.results-table a:hover {
  color: #2e6769;
  text-decoration: underline;
}

.no-results-message {
  margin-top: 30px;
  text-align: center;
}

.no-results-message h3 {
  color: black;
  font-size: 18px;
  font-weight: 500;
}

/* Кнопки экспорта */
.export-buttons {
  margin-bottom: 20px;
  text-align: right;
}

.export-btn {
  padding: 8px 16px;
  font-size: 14px;
  font-family: 'Montserrat', sans-serif;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.export-btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.export-btn-primary {
  background-color: #4dadb0;
  color: white;
  margin-right: 10px;
}

.export-btn-secondary {
  background-color: #6c757d;
  color: white;
}

/* ---------------- Мобильная адаптация ---------------- */
@media (max-width: 768px) {
  .search-page-container {
    padding-top: 90px;
  }

  .search-params-card {
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 14px 16px;
  }

  .ajax-results-container > div {
    width: 100%;
  }

  .export-buttons {
    text-align: center;
    margin-bottom: 15px;
  }

  .export-btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .results-table thead tr:first-child th,
  .results-table thead tr:last-child th,
  .results-table tbody td {
    padding: 8px 10px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .search-param-item {
    max-width: 100%;
    width: 100%;
  }

  /* Позволяет таблице результатов прокручиваться по горизонтали,
     если строки не помещаются на маленьком экране */
  .results-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
}
