/* Download Overlay & Anti-Double-Click Guard */
.download-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.download-overlay.active {
  opacity: 1;
  visibility: visible;
}

.download-overlay-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 32px 36px;
  max-width: 440px;
  width: 90%;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.05);
  transform: scale(0.92) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.download-overlay.active .download-overlay-card {
  transform: scale(1) translateY(0);
}

.download-spinner-wrap {
  position: relative;
  width: 68px;
  height: 68px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.download-spinner {
  width: 100%;
  height: 100%;
  border: 4px solid #f3f4f6;
  border-top-color: #F2D200;
  border-right-color: #111827;
  border-radius: 50%;
  animation: dl-spin 0.9s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
}

.download-icon {
  position: absolute;
  font-size: 24px;
  color: #111827;
}

.download-overlay-title {
  margin: 0 0 8px 0;
  font-size: 19px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.02em;
}

.download-overlay-msg {
  margin: 0 0 20px 0;
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
}

.download-progress-bar {
  width: 100%;
  height: 6px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.download-progress-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #F2D200, #111827);
  border-radius: 999px;
  animation: dl-indeterminate 1.6s infinite ease-in-out;
}

.download-overlay.success .download-spinner {
  border-color: #10b981;
  animation: none;
}

.download-overlay.success .download-icon {
  color: #10b981;
}

.download-overlay.success .download-progress-bar-fill {
  width: 100%;
  background: #10b981;
  animation: none;
}

/* Disabled state on trigger buttons during download */
button.downloading-locked {
  pointer-events: none !important;
  opacity: 0.65 !important;
  cursor: wait !important;
}

@keyframes dl-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes dl-indeterminate {
  0% { left: -40%; width: 40%; }
  50% { left: 30%; width: 60%; }
  100% { left: 100%; width: 40%; }
}
