/* ==========================================================================
   KiddoPlay Arcade - Egyptian Fintech & Subscription Styling
   ========================================================================== */

/* ── Top Bar Actions ── */
.trial-timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 9999px;
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  color: #dc2626;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.trial-timer-pill:hover {
  background: #fee2e2;
  transform: translateY(-1px);
}

.trial-timer-pill.is-subscriber {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #059669;
}

.trial-timer-pill .timer-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulseDot 1.4s infinite;
}

.trial-timer-pill.is-subscriber .timer-pulse-dot {
  background: #10b981;
}

@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.btn-vip-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-vip-badge:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.45);
}

.btn-auth-user {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 9999px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  color: #1e293b;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-auth-user:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.btn-auth-user img.user-avatar-mini {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

/* ── Modal Overlay ── */
.kiddo-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: 1rem;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.kiddo-payment-modal {
  background: #ffffff;
  color: #0f172a;
  border-radius: 26px;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(226, 232, 240, 0.8);
  position: relative;
  display: flex;
  flex-direction: column;
  animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.96) translateY(14px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Modal Header */
.kiddo-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid #f1f5f9;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  z-index: 10;
}

.kiddo-modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.kiddo-modal-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.kiddo-modal-title-group h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

.kiddo-modal-title-group p {
  margin: 2px 0 0 0;
  font-size: 0.82rem;
  color: #64748b;
}

.kiddo-modal-close {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}

.kiddo-modal-close:hover {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
}

/* Modal Body */
.kiddo-modal-body {
  padding: 1.5rem 1.75rem 2rem 1.75rem;
}

/* Plan Hero Card */
.kiddo-plan-card {
  background: linear-gradient(145deg, #fffbeb, #fef3c7);
  border: 2px solid #fde68a;
  border-radius: 20px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.kiddo-plan-badge-popular {
  position: absolute;
  top: 14px;
  right: 14px;
  background: linear-gradient(135deg, #ef4444, #f59e0b);
  color: #ffffff;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

[dir="rtl"] .kiddo-plan-badge-popular {
  right: auto;
  left: 14px;
}

.kiddo-plan-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.kiddo-plan-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: #78350f;
  margin: 0;
}

.kiddo-plan-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.kiddo-price-num {
  font-size: 2.2rem;
  font-weight: 900;
  color: #b45309;
}

.kiddo-price-discounted {
  color: #059669;
}

.kiddo-price-old {
  text-decoration: line-through;
  color: #94a3b8;
  font-size: 1.1rem;
}

.kiddo-price-currency {
  font-size: 0.95rem;
  font-weight: 800;
  color: #78350f;
}

.kiddo-features-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kiddo-features-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #451a03;
}

.kiddo-features-list li svg {
  flex-shrink: 0;
  color: #10b981;
}

/* Extra Devices Stepper (1 link free for 5 persons, +50 EGP each extra) */
.kiddo-devices-sharing-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.kiddo-devices-info h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.kiddo-devices-info p {
  margin: 4px 0 0 0;
  font-size: 0.8rem;
  color: #64748b;
}

.kiddo-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 9999px;
  padding: 3px 8px;
}

.kiddo-step-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #1e293b;
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.kiddo-step-btn:hover:not(:disabled) {
  background: #e2e8f0;
}

.kiddo-step-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.kiddo-step-count {
  font-weight: 800;
  font-size: 0.95rem;
  min-width: 45px;
  text-align: center;
  color: #0f172a;
}

/* Referral Code Section (Student discount 50 EGP & Teacher 50 EGP) */
.kiddo-referral-card {
  background: #f0fdf4;
  border: 1.5px dashed #86efac;
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.kiddo-referral-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.kiddo-referral-title h4 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  color: #166534;
}

.kiddo-referral-input-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.kiddo-referral-input {
  flex: 1;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1.5px solid #bbf7d0;
  background: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  color: #14532d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kiddo-referral-input:focus {
  outline: none;
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.kiddo-btn-apply-code {
  padding: 8px 18px;
  border-radius: 12px;
  background: #16a34a;
  color: #ffffff;
  border: none;
  font-weight: 800;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.2s;
}

.kiddo-btn-apply-code:hover {
  background: #15803d;
}

.kiddo-ref-status-msg {
  font-size: 0.8rem;
  margin-top: 6px;
  font-weight: 700;
}

.kiddo-ref-status-msg.success { color: #15803d; }
.kiddo-ref-status-msg.error { color: #dc2626; }

/* Referral Sharing Banner (For Subscribed Teachers & Parents) */
.kiddo-referral-share-box {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 1.5px solid #bfdbfe;
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.kiddo-ref-code-display {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid #93c5fd;
  font-weight: 800;
  color: #1e40af;
  font-size: 0.95rem;
}

/* Payment Methods (InstaPay & Wallets) */
.kiddo-methods-header {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 10px 0;
}

.kiddo-methods-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.kiddo-method-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 2px solid #e2e8f0;
  background: #ffffff;
  font-weight: 800;
  font-size: 0.86rem;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
}

.kiddo-method-tab img {
  height: 22px;
  object-fit: contain;
}

.kiddo-method-tab.active {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.kiddo-account-details-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.kiddo-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #edf2f7;
}

.kiddo-account-row:last-child {
  border-bottom: none;
}

.kiddo-account-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
}

.kiddo-account-val {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.92rem;
  color: #0f172a;
  direction: ltr;
}

.kiddo-copy-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}

.kiddo-copy-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.kiddo-copy-btn.copied {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}

/* Upload Receipt Zone */
.kiddo-upload-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 18px;
  padding: 1.5rem 1rem;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.kiddo-upload-dropzone:hover {
  border-color: #f59e0b;
  background: #fffdf5;
}

.kiddo-upload-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.kiddo-upload-icon {
  font-size: 2.2rem;
  margin-bottom: 6px;
}

.kiddo-upload-prompt {
  font-weight: 800;
  font-size: 0.92rem;
  color: #1e293b;
  margin: 0;
}

.kiddo-upload-subtext {
  font-size: 0.78rem;
  color: #64748b;
  margin: 4px 0 0 0;
}

/* Receipt Preview & Audit Status */
.kiddo-receipt-preview-wrap {
  margin-top: 1rem;
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px solid #e2e8f0;
  position: relative;
  max-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
}

.kiddo-receipt-preview-wrap img {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
}

.kiddo-audit-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  margin-top: 12px;
  font-weight: 700;
  font-size: 0.84rem;
}

.kiddo-audit-badge.scanning {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

.kiddo-audit-badge.verified {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.kiddo-audit-badge.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.kiddo-btn-confirm-pay {
  width: 100%;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #ffffff;
  border: none;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  margin-top: 14px;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.3);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.kiddo-btn-confirm-pay:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.4);
}

.kiddo-btn-confirm-pay:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #94a3b8;
  box-shadow: none;
}

/* ── Fullscreen Paywall Overlay (When 10 Minutes Expire) ── */
.kiddo-paywall-screen {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999999;
  padding: 1.5rem;
  animation: fadeIn 0.3s ease-out;
}

.kiddo-paywall-box {
  background: #ffffff;
  border-radius: 28px;
  max-width: 580px;
  width: 100%;
  padding: 2.25rem 2rem;
  text-align: center;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.5);
  animation: modalScale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.kiddo-paywall-icon-big {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.25rem auto;
  border-radius: 24px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.35);
  animation: pulseDot 2s infinite;
}

.kiddo-paywall-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: #0f172a;
  margin: 0 0 8px 0;
}

.kiddo-paywall-desc {
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.6;
  margin: 0 0 1.5rem 0;
}

.kiddo-paywall-features-pill {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 12px 16px;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-around;
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
}

.kiddo-btn-paywall-unlock {
  width: 100%;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #ffffff;
  border: none;
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
  transition: all 0.2s ease;
}

.kiddo-btn-paywall-unlock:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 8px 26px rgba(245, 158, 11, 0.5);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .kiddo-payment-modal {
    max-height: 94vh;
    border-radius: 20px;
  }
  .kiddo-modal-header, .kiddo-modal-body {
    padding: 1rem 1.15rem;
  }
  .kiddo-plan-price-row .kiddo-price-num {
    font-size: 1.8rem;
  }
  .kiddo-features-list {
    grid-template-columns: 1fr;
  }
  .trial-timer-pill span.timer-label {
    display: none;
  }
}
