.modal,
#imageModal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal.active,
#imageModal.active {
  display: flex;
}

.modal-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: background var(--transition);
  z-index: 2001;
}

.modal-close:hover {
  background: rgba(255,255,255,0.2);
}

.modal-content {
  background: var(--card);
  padding: 32px;
  border-radius: var(--radius-lg);
  max-width: 720px;
  width: 100%;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-align: center;
}

.modal-content img {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.modal-content h2 {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.modal-content p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
}

#imageModal .modal-content {
  background: transparent;
  padding: 0;
  border: none;
  max-width: 90vw;
  max-height: 90vh;
  box-shadow: none;
}

#imageModal .modal-content,
#modalImage {
  width: auto;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius-lg);
  object-fit: contain;
}

#backToTop {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px var(--primary-glow);
  transition: all var(--transition);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  z-index: 900;
}

#backToTop.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#backToTop:hover {
  background: var(--primary-light);
  transform: translateY(-3px);
  box-shadow: 0 8px 28px var(--primary-glow);
}

.modal-open {
  overflow: hidden;
}