.gabarit {
  padding: 60px 0;
  background-color: #f5f5f5;
}

.gabarit__descr {
  color: white;
  padding: 30px;
  text-align: center;
}

.controls {
  padding: 25px 25px 25px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: flex-end;
  justify-content: flex-start;
}

.control-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
}

.control-label {
  color: #6c757d;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.control-field .filter-select {
  width: 100%;
}

.filter-select {
  padding: 12px 16px;
  border: 2px solid #e1e5e9;
  border-radius: 12px;
  background: white;
  font-size: 14px;
  cursor: pointer;
}

.filter-select:disabled {
  background-color: #f5f5f5;
  color: #999;
  cursor: not-allowed;
}

/* Анимация для смены изображений */
#dynamic-image {
  transition: opacity 0.3s ease-in-out;
}

.table-container {
  overflow: auto;
  max-height: 70vh;
  position: relative;
}

.table-container table tbody:empty {
  display: none;
}

#noResults {
  padding: 40px 20px;
  text-align: center;
  color: #666;
  font-size: 16px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  min-width: 1200px;
}

.data-table thead th {
  background: #2c3e50;
  color: white;
  padding: 15px 8px;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 0;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background-color 0.2s;
}

.data-table thead th:hover {
  background: #34495e;
}

.data-table thead th.sortable::after {
  content: " ↕";
  opacity: 0.5;
  font-size: 10px;
}

.data-table thead th.sort-asc::after {
  content: " ↑";
  opacity: 1;
  color: #3498db;
}

.data-table thead th.sort-desc::after {
  content: " ↓";
  opacity: 1;
  color: #3498db;
}

.data-table tbody td {
  padding: 12px 8px;
  border-bottom: 1px solid #e9ecef;
  white-space: nowrap;
  transition: background-color 0.2s;
  text-align: center;
}

.data-table tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}

.data-table tbody tr:hover {
  background: linear-gradient(90deg, #e3f2fd 0%, #f3e5f5 100%);
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

#tableBody {
  font-size: 1.5rem;
}

.type-badge {
  margin: 0 auto;
  padding: 4px 8px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.5rem;
  text-align: center;
}

.type-1-8 {
  background: #e8f5e8;
  color: #388e3c;
}
.type-2-0 {
  background: #e3f2fd;
  color: #1976d2;
}
.type-2-2 {
  background: #f3e5f5;
  color: #7b1fa2;
}
.type-2-5 {
  background: #f3e5f5;
  color: #7b1fa2;
}
.type-2-8 {
  background: #fff3e0;
  color: #f57c00;
}
.type-3-15 {
  background: #e8f5e8;
  color: #388e3c;
}
.type-3-55 {
  background: #e0f2f1;
  color: #00695c;
}
.type-4-0 {
  background: #fff3e0;
  color: #f57c00;
}
.type-4-5 {
  background: #fce4ec;
  color: #c2185b;
}
.type-5-0 {
  background: #fce4ec;
  color: #c2185b;
}
.type-5-6 {
  background: #e0f2f1;
  color: #00695c;
}
.type-6-3 {
  background: #e0f2f1;
  color: #00695c;
}
.type-7-1 {
  background: #f1f8e9;
  color: #558b2f;
}
.type-8-0 {
  background: #f1f8e9;
  color: #558b2f;
}
.type-9-0 {
  background: #f3e5f5;
  color: #7b1fa2;
}
.type-10-0 {
  background: #e3f2fd;
  color: #1976d2;
}
.type-11-2-1 {
  background: #e8f5e8;
  color: #388e3c;
}
.type-11-2-2 {
  background: #e3f2fd;
  color: #1976d2;
}

.no-results {
  text-align: center;
  padding: 40px;
  color: #6c757d;
  font-size: 16px;
}

.image-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  align-items: flex-start;
}

.image-container img {
  max-height: 412px;
  display: block;
  transition: opacity 0.3s ease-in-out;
}

.image-container img#dynamic-image {
  border: 1px solid #ddd;
}

.image-container img#aero-image {
  border: 1px solid #aaa;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Модальное окно для зума */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  opacity: 1;
}

.modal-content {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
}

.close:hover,
.close:focus {
  color: #999;
  text-decoration: none;
}

.image-container img {
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s ease;
}

.image-container img:hover {
  border-color: #3498db;
}

@media (max-width: 1024px) {
  .data-table {
    font-size: 11px;
  }

  .data-table thead th,
  .data-table tbody td {
    padding: 8px 4px;
  }

  .controls {
    gap: 12px;
  }
}

@media (max-width: 768px) {
  .container {
    border-radius: 12px;
  }

  .header {
    padding: 20px;
  }

  .header h1 {
    font-size: 22px;
  }

  .controls {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .control-field {
    min-width: 0;
    width: 100%;
  }

  .image-container {
    flex-direction: column;
    gap: 10px;
  }

  .image-container img {
    max-width: 100%;
  }

  .gabarit__descr {
    padding: 0;
  }

  .gabarit__img {
    flex-direction: column;
  }

  .gabarit__img img {
    max-width: 100%;
  }

  .filter-select {
    margin-bottom: 0;
  }
}
