/**
 * ColorKidPlay - Download Delay & Countdown Modal Styles
 */

.ckp-download-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ckp-download-modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.ckp-download-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ckp-download-modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  background: #ffffff;
  border-radius: 28px;
  padding: 32px 28px 24px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  text-align: center;
  transform: scale(0.92) translateY(12px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.ckp-download-modal-overlay.is-active .ckp-download-modal-card {
  transform: scale(1) translateY(0);
}

.ckp-download-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.ckp-download-modal-close svg {
  width: 18px;
  height: 18px;
}

.ckp-download-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: rotate(90deg);
}

/* Visual & SVG Countdown */
.ckp-download-visual {
  position: relative;
  width: 130px;
  height: 130px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ckp-countdown-circle-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}

.ckp-countdown-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ckp-countdown-track {
  fill: none;
  stroke: #e2e8f0;
  stroke-width: 7;
}

.ckp-countdown-indicator {
  fill: none;
  stroke: #ff9800;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.15s linear, stroke 0.3s ease;
}

.ckp-countdown-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ckp-countdown-number {
  font-family: 'Fredoka', 'Nunito', sans-serif;
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  color: #0f172a;
}

.ckp-countdown-unit {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.ckp-download-art-icon {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 38px;
  height: 38px;
  background: #ff7a45;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(255, 122, 69, 0.35);
  border: 3px solid #ffffff;
}

.ckp-download-art-icon svg {
  width: 18px;
  height: 18px;
}

/* Success state on completion */
.ckp-download-modal-card.is-ready .ckp-countdown-indicator {
  stroke: #10b981;
}

.ckp-download-modal-card.is-ready .ckp-download-art-icon {
  background: #10b981;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
  animation: ckpPulseBounce 1s infinite alternate;
}

@keyframes ckpPulseBounce {
  0% { transform: scale(1); }
  100% { transform: scale(1.15); }
}

/* Typography */
.ckp-download-title {
  font-family: 'Fredoka', 'Nunito', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 8px;
  line-height: 1.35;
}

.ckp-download-desc {
  font-size: 14px;
  color: #475569;
  margin: 0 0 20px;
  line-height: 1.5;
}

/* Tip panel */
.ckp-download-tip-panel {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1px solid #fde68a;
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 20px;
  text-align: left;
}

.ckp-download-tip-head {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

.ckp-download-tip-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: #92400e;
  letter-spacing: 0.5px;
}

.ckp-download-tip-badge svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.ckp-download-tip-text {
  font-size: 13px;
  color: #78350f;
  margin: 0;
  line-height: 1.45;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

/* Actions */
.ckp-download-actions {
  margin-bottom: 16px;
}

.ckp-download-btn-ready {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  border-radius: 14px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.ckp-download-btn-ready:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
  color: #ffffff;
}

.ckp-download-btn-ready svg {
  width: 18px;
  height: 18px;
}

.ckp-download-footer-note {
  margin-top: 4px;
}

.ckp-download-cancel-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.ckp-download-cancel-btn:hover {
  color: #ef4444;
  background: #fee2e2;
}

@media (max-width: 480px) {
  .ckp-download-modal-card {
    padding: 28px 20px 20px;
    border-radius: 24px;
  }
  .ckp-download-visual {
    width: 110px;
    height: 110px;
  }
  .ckp-countdown-number {
    font-size: 34px;
  }
  .ckp-download-title {
    font-size: 18px;
  }
  .ckp-download-desc {
    font-size: 13px;
  }
}

/* ==========================================================================
   In-Button Countdown (Single Image Download - No Popup Modal)
   ========================================================================== */
.ckp-btn-counting {
  position: relative !important;
  cursor: wait !important;
  pointer-events: none !important;
  opacity: 0.95 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  transition: all 0.2s ease !important;
  user-select: none !important;
}

.gallery-item .download-mini.ckp-btn-counting {
  background: #0f766e !important;
  border-color: #0d5f58 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.3) !important;
}

.pill-button.ckp-btn-counting {
  background: #0f766e !important;
  color: #ffffff !important;
  border-color: #0d5f58 !important;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.3) !important;
}

.download-row.ckp-btn-counting {
  background: #f0fdfa !important;
  color: #0f766e !important;
  border-color: #5eead4 !important;
}

.ckp-btn-counting .ckp-btn-spinner {
  width: 16px !important;
  height: 16px !important;
  animation: ckp-btn-spin 0.85s linear infinite !important;
  flex: none !important;
}

.ckp-btn-done {
  background: #10b981 !important;
  border-color: #059669 !important;
  color: #ffffff !important;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.35) !important;
}

.download-row.ckp-btn-done {
  background: #ecfdf5 !important;
  color: #059669 !important;
  border-color: #6ee7b7 !important;
}

.ckp-btn-done svg {
  width: 16px !important;
  height: 16px !important;
  flex: none !important;
}

@keyframes ckp-btn-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

