* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: system-ui, "Segoe UI", "Tahoma", "Poppins", "Vazirmatn", sans-serif;
}

body {
  background: linear-gradient(145deg, #e0eafc 0%, #cfdef3 100%);
  min-height: 100vh;
  padding: 2rem 1.5rem;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(1px);
  border-radius: 3rem;
  padding: 2rem 2rem 2.5rem;
  box-shadow:
    0 25px 45px rgba(0, 0, 0, 0.1),
    0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #1a2a3f, #2c5368);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  letter-spacing: -0.5px;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.05);
}

.header p {
  color: #2c3e66;
  font-weight: 500;
  margin-top: 0.5rem;
  font-size: 1rem;
  opacity: 0.8;
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.8rem;
  margin-bottom: 3rem;
}

.btn-download {
  background: rgba(30, 45, 70, 0.85);
  backdrop-filter: blur(8px);
  border: none;
  padding: 1rem 2.2rem;
  border-radius: 60px;
  font-size: 1.2rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  letter-spacing: 0.3px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-download i {
  font-style: normal;
  font-size: 1.3rem;
  font-weight: 400;
}

.btn-download:hover {
  transform: translateY(-5px);
  background: #1e3b5c;
  box-shadow: 0 18px 30px -8px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 240, 0.5);
}

.btn-download:active {
  transform: translateY(2px);
}

.btn-mri {
  background: linear-gradient(125deg, #3a5e7a, #264653);
}

.gallery-section {
  margin-top: 1.5rem;
}

.gallery-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 2px dashed rgba(40, 60, 90, 0.3);
  padding-bottom: 0.75rem;
  margin-bottom: 1.8rem;
  flex-wrap: wrap;
}

.gallery-title h2 {
  font-size: 1.6rem;
  font-weight: 600;
  color: #1e2f41;
}

.gallery-title span {
  background: #2c3e4e30;
  padding: 0.3rem 1rem;
  border-radius: 40px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #1f3b4c;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1.8rem;
  transition: all 0.2s;
}

.gallery-item {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(3px);
  border-radius: 1.6rem;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  transform: scale(1);
  border: 1px solid rgba(255, 255, 210, 0.5);
}

.gallery-item:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 28px -12px rgba(0, 0, 0, 0.3);
  background: white;
  border-color: #cbd5e1;
}

.gallery-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
  background: #eef2f7;
}

.gallery-item:hover .gallery-img {
  transform: scale(1.02);
}

.img-info {
  padding: 0.8rem 1rem;
  text-align: center;
  background: rgba(250, 250, 252, 0.9);
  font-size: 0.8rem;
  font-weight: 500;
  color: #2c3f55;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.img-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
  direction: ltr;
  font-family: monospace;
}

.download-icon {
  background: #1f4662;
  padding: 4px 8px;
  border-radius: 30px;
  color: white;
  font-size: 0.7rem;
  font-weight: bold;
  transition: 0.2s;
}

.gallery-item:hover .download-icon {
  background: #0f2c41;
  transform: scale(1.05);
}

.loader {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  gap: 12px;
  font-size: 1.1rem;
  color: #2c4e6e;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 4px solid #bdd3e8;
  border-top: 4px solid #1f4c6e;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.error-msg {
  background: #fff0f0;
  color: #b91c1c;
  padding: 1rem;
  border-radius: 2rem;
  text-align: center;
  border-right: 6px solid #b91c1c;
}

.empty-msg {
  background: #ecfdf5;
  padding: 2rem;
  text-align: center;
  border-radius: 2rem;
  color: #2b6e4f;
  font-weight: 500;
}

.footer-note {
  margin-top: 2.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: #2c5a74;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding-top: 1.5rem;
}

@media (max-width: 640px) {
  body {
    padding: 1rem;
  }
  .container {
    padding: 1.2rem;
  }
  .btn-download {
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
  }
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }
}
