/**
 * ColorKidPlay App Download Popup Styles
 */

:root {
  --ckp-popup-accent: #f93b83;
  --ckp-popup-navy: #0e2246;
  --ckp-popup-slate: #546682;
  --ckp-popup-bg: #ffffff;
  --ckp-popup-radius: 26px;
}

/* Modal Overlay */
.ckp-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

.ckp-popup-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

/* Backdrop with Glass Blur */
.ckp-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 26, 50, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Dialog Container */
.ckp-popup-dialog {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  background: var(--ckp-popup-bg);
  border-radius: var(--ckp-popup-radius);
  box-shadow:
    0 24px 50px -12px rgba(14, 34, 70, 0.28),
    0 0 0 1px rgba(22, 45, 85, 0.06);
  padding: 30px 24px 22px;
  box-sizing: border-box;
  text-align: center;
  transform: scale(0.92) translateY(18px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.ckp-popup-overlay.is-visible .ckp-popup-dialog {
  transform: scale(1) translateY(0);
}

/* Decorative Top Pastel Ribbon */
.ckp-popup-dialog::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #f93b83, #ff8c42, #ffcf33, #15b977, #197ddd);
}

/* Close Button (X icon) */
.ckp-popup-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: #f1f5f9;
  color: #64748b;
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}

.ckp-popup-close:hover,
.ckp-popup-close:focus-visible {
  background: #e2e8f0;
  color: #0f172a;
  transform: scale(1.08);
  outline: none;
}

/* Header & Avatar */
.ckp-popup-header {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ckp-app-avatar {
  position: relative;
  width: 76px;
  height: 76px;
  margin-bottom: 12px;
}

.ckp-app-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 19px;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(249, 59, 131, 0.28);
}

.ckp-sparkle-pill {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #ffcc00;
  color: #6b4300;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(255, 204, 0, 0.45);
}

/* Rating Badge */
.ckp-rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  background: #fff8e6;
  border: 1px solid #ffecb3;
  margin-bottom: 10px;
}

.ckp-star-icons {
  display: inline-flex;
  gap: 2px;
  color: #f59e0b;
}

.ckp-badge-text {
  font-size: 11.5px;
  font-weight: 800;
  color: #855302;
  font-family: inherit;
}

/* Typography */
.ckp-popup-title {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 900;
  line-height: 1.3;
  color: var(--ckp-popup-navy);
  font-family: inherit;
  word-break: break-word;
}

.ckp-popup-desc {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ckp-popup-slate);
  font-family: inherit;
  max-width: 360px;
}

/* Features Chips */
.ckp-popup-features {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 20px;
  text-align: left;
}

.ckp-feat-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  font-family: inherit;
}

.ckp-feat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
}

.feat-palette {
  background: #fce7f3;
  color: #db2777;
}

.feat-wifi {
  background: #e0f2fe;
  color: #0284c7;
}

.feat-shield {
  background: #dcfce7;
  color: #16a34a;
}

/* Store Action Buttons */
.ckp-store-actions {
  display: grid;
  gap: 10px;
  width: 100%;
  margin-bottom: 12px;
}

/* Layout adaptation: 2 stores = 2 cols on desktop/tablet, 1 store = full width */
.ckp-popup-dialog.has-two-stores .ckp-store-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ckp-popup-dialog.has-single-store .ckp-store-actions {
  grid-template-columns: 1fr;
}

.ckp-store-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #0f172a;
  color: #ffffff !important;
  text-decoration: none !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
  text-align: left;
}

.ckp-store-btn:hover,
.ckp-store-btn:focus-visible {
  background: #1e293b;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.28);
  color: #ffffff !important;
}

.ckp-store-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ckp-store-label {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}

.ckp-store-label small {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}

.ckp-store-label strong {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
}

/* Single store prominent style */
.ckp-popup-dialog.has-single-store .ckp-store-btn {
  justify-content: center;
  padding: 12px 18px;
}

.ckp-popup-dialog.has-single-store .ckp-store-label strong {
  font-size: 16px;
}

/* Coming Soon Fallback */
.ckp-store-coming-soon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
}

.ckp-cs-icon {
  color: var(--ckp-popup-accent);
}

/* Footer Dismiss Link */
.ckp-popup-footer {
  margin-top: 4px;
}

.ckp-popup-dismiss-link {
  background: transparent;
  border: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
  font-family: inherit;
}

.ckp-popup-dismiss-link:hover,
.ckp-popup-dismiss-link:focus-visible {
  color: #0f172a;
  background: #f1f5f9;
  outline: none;
}

/* ==========================================================================
   Test App Recruitment Popup Variant
   ========================================================================== */

.ckp-dialog-test-app {
  max-width: 460px;
  padding: 26px 22px 18px;
}

/* Beaker Sparkle Pill */
.ckp-beaker-badge {
  background: linear-gradient(135deg, #06b6d4, #3b82f6) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 10px rgba(6, 182, 212, 0.45) !important;
}

/* Test Pill Badge with pulse dot */
.ckp-test-pill-badge {
  background: #ecfdf5 !important;
  border: 1px solid #a7f3d0 !important;
  gap: 7px;
}

.ckp-test-pill-badge .ckp-badge-text {
  color: #047857 !important;
}

.ckp-test-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: ckp-pulse-dot 1.8s infinite;
}

@keyframes ckp-pulse-dot {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Test Steps Container */
.ckp-test-steps-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 8px;
}

.ckp-test-step-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 13px 15px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  transition: all 0.2s ease;
  text-align: left;
}

.ckp-test-step-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.ckp-test-step-card.is-completed {
  border-color: #10b981;
  background: #f0fdf4;
}

.ckp-test-step-card.is-completed .ckp-step-num-circle {
  background: #10b981;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.ckp-test-step-card.is-focused-next {
  border-color: var(--ckp-popup-accent);
  box-shadow: 0 0 0 3px rgba(249, 59, 131, 0.15);
}

.ckp-step-left {
  display: flex;
  align-items: center;
  gap: 11px;
}

.ckp-step-num-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f93b83, #fb7185);
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(249, 59, 131, 0.3);
}

.ckp-step-num-2 {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.ckp-step-text-meta {
  flex: 1;
  min-width: 0;
}

.ckp-step-name {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

.ckp-step-subdesc {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.35;
}

/* Step Connector Line */
.ckp-step-divider-line {
  position: relative;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 28px;
  box-sizing: border-box;
}

.ckp-step-divider-line::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 28px;
  width: 2px;
  background: repeating-linear-gradient(to bottom, #cbd5e1 0, #cbd5e1 3px, transparent 3px, transparent 6px);
}

/* Test Action Buttons */
.ckp-test-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none !important;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  box-sizing: border-box;
}

.ckp-test-action-btn:hover,
.ckp-test-action-btn:focus-visible {
  transform: translateY(-1px);
}

.ckp-btn-step1 {
  background: #0f172a;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.ckp-btn-step1:hover {
  background: #1e293b;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.25);
  color: #ffffff !important;
}

.ckp-step-card-1.is-completed .ckp-btn-step1 {
  background: #059669;
}

.ckp-btn-step2 {
  background: linear-gradient(135deg, var(--ckp-popup-accent), #e11d6d);
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(249, 59, 131, 0.28);
}

.ckp-btn-step2:hover {
  background: linear-gradient(135deg, #e11d6d, #be123c);
  box-shadow: 0 6px 18px rgba(249, 59, 131, 0.38);
  color: #ffffff !important;
}

.ckp-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ckp-btn-arrow {
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
  opacity: 0.8;
}

/* Guide Toggle Button */
.ckp-guide-btn-wrapper {
  margin-top: 10px;
  margin-bottom: 4px;
}

.ckp-guide-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none !important;
  transition: all 0.15s ease;
  font-family: inherit;
  box-sizing: border-box;
}

.ckp-guide-toggle-btn:hover,
.ckp-guide-toggle-btn:focus-visible {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
  outline: none;
}

/* Eye-catching styling when it is a direct article link */
.ckp-guide-article-link-btn {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #86efac;
  color: #166534;
}

.ckp-guide-article-link-btn:hover,
.ckp-guide-article-link-btn:focus-visible {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  border-color: #4ade80;
  color: #14532d;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.15);
  transform: translateY(-1px);
}

.ckp-guide-article-link-btn .ckp-guide-icon-pill {
  background: #16a34a !important;
  color: #ffffff !important;
}

.ckp-guide-article-link-btn .ckp-guide-toggle-arrow {
  color: #16a34a;
}

.ckp-guide-article-link-btn:hover .ckp-guide-toggle-arrow {
  color: #15803d;
  transform: translateX(3px);
}

.ckp-guide-toggle-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ckp-guide-icon-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: #e0f2fe;
  color: #0284c7;
}

.ckp-guide-toggle-arrow {
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  transition: transform 0.15s;
}

.ckp-guide-toggle-btn:hover .ckp-guide-toggle-arrow {
  transform: translateX(2px);
  color: #475569;
}

/* Detailed Guide View Container */
.ckp-test-guide-view {
  text-align: left;
  animation: ckp-fade-in 0.25s ease;
}

@keyframes ckp-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ckp-guide-view-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf2f7;
}

.ckp-guide-back-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 0;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  flex-shrink: 0;
}

.ckp-guide-back-button:hover,
.ckp-guide-back-button:focus-visible {
  background: #e2e8f0;
  color: #0f172a;
}

.ckp-guide-view-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
}

.ckp-guide-steps-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  max-height: 290px;
  overflow-y: auto;
  padding-right: 2px;
}

.ckp-guide-step-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 9px 11px;
  background: #f8fafc;
  border-radius: 11px;
  border: 1px solid #edf2f7;
}

.ckp-guide-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

.ckp-guide-row-content strong {
  display: block;
  font-size: 12.5px;
  color: #0f172a;
  margin-bottom: 2px;
}

.ckp-guide-row-content p {
  margin: 0;
  font-size: 11.5px;
  color: #475569;
  line-height: 1.45;
}

.ckp-guide-callout-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 9px 11px;
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-radius: 11px;
  color: #92400e;
  font-size: 11.5px;
  line-height: 1.4;
}

.ckp-callout-icon {
  color: #d97706;
  flex-shrink: 0;
  margin-top: 1px;
}

.ckp-callout-text strong {
  display: inline;
  color: #78350f;
  margin-right: 4px;
}

.ckp-guide-ext-link-wrap {
  margin-bottom: 10px;
}

.ckp-guide-ext-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  width: 100%;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  color: #1d4ed8 !important;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none !important;
  transition: all 0.15s;
  box-sizing: border-box;
}

.ckp-guide-ext-link-btn:hover {
  background: #dbeafe;
  color: #1e40af !important;
}

.ckp-guide-confirm-btn {
  width: 100%;
  padding: 10px 14px;
  background: #0f172a;
  color: #ffffff;
  border: 0;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s;
  font-family: inherit;
}

.ckp-guide-confirm-btn:hover,
.ckp-guide-confirm-btn:focus-visible {
  background: #1e293b;
  outline: none;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .ckp-popup-dialog {
    padding: 24px 18px 18px;
    border-radius: 20px;
    max-width: 100%;
  }

  .ckp-dialog-test-app {
    padding: 20px 16px 16px;
  }

  .ckp-popup-title {
    font-size: 18px;
  }

  .ckp-popup-desc {
    font-size: 12px;
  }

  /* Stack store buttons on small mobile */
  .ckp-popup-dialog.has-two-stores .ckp-store-actions {
    grid-template-columns: 1fr;
  }

  .ckp-store-btn {
    justify-content: center;
    padding: 11px 14px;
  }

  .ckp-test-step-card {
    padding: 11px 13px;
  }

  .ckp-step-num-circle {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }

  .ckp-step-name {
    font-size: 13px;
  }

  .ckp-test-action-btn {
    padding: 9px 12px;
    font-size: 12.5px;
  }

  .ckp-guide-steps-container {
    max-height: 240px;
  }
}

/* Prevent background scrolling when popup is open */
body.ckp-popup-active {
  overflow: hidden;
}

