.page-content {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 40px 20px;
}

.page-title {
  color: #ffffff;
  font-size: clamp(28px, 8vw, 48px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 4px;
  margin-bottom: 20px;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
  text-align: center;
}

.tier-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 30px;
  max-width: 1300px;
  width: 100%;
  padding: 0 20px;
}

.tier-btn {
  padding: 8px 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.5);
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}

.tier-btn:hover {
  border-color: rgba(255, 255, 255, 0.5);
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
}

.tier-btn.active {
  border-color: #ff6b4a;
  color: #ffffff;
  background: rgba(255, 107, 74, 0.25);
  box-shadow: 0 0 12px rgba(255, 107, 74, 0.3);
}

.no-machines {
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  grid-column: 1 / -1;
  padding: 40px;
  font-size: 18px;
}

.back-btn {
  display: inline-block;
  padding: 12px 30px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: all 0.3s ease;
}

.back-btn:hover {
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.machines-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
  width: 100%;
  max-width: 1300px;
  margin-bottom: 40px;
  padding: 0 20px;
}

.machine-card {
  background: rgba(30, 30, 30, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: cardFadeIn 0.5s ease forwards;
  opacity: 0;
  display: flex;
  flex-direction: column;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.machine-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 107, 74, 0.6);
  box-shadow: 0 10px 30px rgba(255, 107, 74, 0.2);
}

.card-image-container {
  width: 100%;
  flex: 1;
  min-height: 180px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  padding: 0;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.machine-card:hover .card-image {
  transform: scale(1.08);
}

.card-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.25),
    transparent
  );
  flex-shrink: 0;
}

.card-name-container {
  padding: 14px 12px;
  background: rgba(0, 0, 0, 0.5);
  text-align: center;
  flex-shrink: 0;
}

.card-name {
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(255, 107, 74, 0.4);
  border-radius: 20px;
  padding: 40px 35px 35px;
  width: min(95vw, 1200px);
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1001;
  animation: modalIn 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
              0 0 40px rgba(255, 107, 74, 0.1);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 32px;
  cursor: pointer;
  transition: color 0.2s ease;
  line-height: 1;
  z-index: 10;
}

.modal-close:hover {
  color: #ff6b4a;
}

.modal-title {
  color: #ffffff;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 25px;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.modal-images {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  align-items: center;
  margin-bottom: 25px;
}

.modal-image-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 350px;
  min-width: 280px;
  max-width: 600px;
  aspect-ratio: 4 / 3;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  overflow: hidden;
  padding: 15px;
  cursor: pointer;
}

.modal-image-wrapper:only-child {
  flex: 1 1 500px;
  max-width: 800px;
  aspect-ratio: 16 / 10;
}

.modal-image-wrapper:only-child .modal-image {
  max-width: 95%;
  max-height: 95%;
}

.modal-image {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.modal-description {
  color: rgba(255, 255, 255, 0.75);
  font-size: clamp(15px, 2vw, 17px);
  line-height: 1.7;
  text-align: center;
  padding: 15px 10px 0;
}

.no-images {
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  padding: 40px 20px;
  font-style: italic;
  width: 100%;
}

.error-message {
  color: #ff6b4a;
  text-align: center;
  grid-column: 1 / -1;
  padding: 40px;
}

.modal-content::-webkit-scrollbar {
  width: 6px;
}

.modal-content::-webkit-scrollbar-track {
  background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.zoom-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.zoom-overlay.active {
  display: flex;
}

.zoom-close {
  position: absolute;
  top: 20px;
  right: 30px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 40px;
  cursor: pointer;
  transition: color 0.2s ease;
  line-height: 1;
  z-index: 10;
}

.zoom-close:hover {
  color: #ff6b4a;
}

.zoom-image {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
  cursor: default;
}

@media (max-width: 1000px) {
  .machines-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  .modal-content {
    padding: 30px 25px 25px;
  }

  .modal-image-wrapper {
    flex: 1 1 280px;
    min-width: 240px;
  }

  .modal-image-wrapper:only-child {
    flex: 1 1 400px;
    max-width: 100%;
  }
}

@media (max-width: 750px) {
  .machines-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .modal-content {
    padding: 25px 20px 20px;
    width: 95vw;
  }

  .modal-title {
    font-size: 22px;
  }

  .modal-images {
    gap: 12px;
  }

  .modal-image-wrapper {
    flex: 1 1 250px;
    min-width: 200px;
    padding: 10px;
  }

  .modal-image-wrapper:only-child {
    flex: 1 1 300px;
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 480px) {
  .machines-grid {
    grid-template-columns: 1fr;
    max-width: 350px;
    margin-left: auto;
    margin-right: auto;
  }

  .modal-content {
    padding: 20px 15px 20px;
  }

  .modal-image-wrapper {
    flex: 1 1 100%;
    min-width: 100%;
    aspect-ratio: 4 / 3;
  }

  .modal-image-wrapper:only-child {
    aspect-ratio: 4 / 3;
  }
}