/**
 * DoYouThinkYouCanSpell.com - Modal & Lead Capture Styling
 */

/* Modal Backdrop Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 29, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

/* Modal Card Container */
.modal-card {
  position: relative;
  width: 100%;
  max-width: 620px;
  background: var(--bg-surface, #0E291D);
  border: 1px solid var(--border-gold, rgba(245, 158, 11, 0.4));
  border-radius: var(--radius-xl, 1.25rem);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(245, 158, 11, 0.15);
  padding: 2rem 1.75rem;
  margin: auto;
  max-height: 92vh;
  overflow-y: auto;
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalPop {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Close Button */
.btn-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary, #94A3B8);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #EF4444;
  border-color: rgba(239, 68, 68, 0.4);
}

/* Modal Header */
.modal-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.modal-trophy {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 4px 12px rgba(245, 158, 11, 0.4));
  animation: bounceTrophy 1.5s infinite ease-in-out;
}

@keyframes bounceTrophy {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.modal-headline {
  font-family: var(--font-display, 'Outfit', sans-serif);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary, #F8FAFC);
  margin-bottom: 0.5rem;
}

.modal-badge-pill {
  display: inline-block;
  padding: 0.35rem 1rem;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--accent-gold, #F59E0B);
  color: var(--accent-gold, #F59E0B);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 9999px;
}

/* Summary Stats Grid */
.summary-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.stat-box {
  background: rgba(7, 26, 18, 0.7);
  border: 1px solid rgba(167, 243, 208, 0.12);
  border-radius: 0.75rem;
  padding: 0.875rem 0.5rem;
  text-align: center;
}

.stat-number {
  display: block;
  font-family: var(--font-display, 'Outfit', sans-serif);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-gold, #F59E0B);
  line-height: 1.2;
}

.stat-title {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted, #A7F3D0);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* Challenger Result Banner */
.challenger-result-banner {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1.25rem;
}

.challenger-result-banner.beat-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34D399;
}

.challenger-result-banner.beat-missed {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #FBBF24;
}

/* Official Nigeria Spelling Bee Conversion Banner */
.nsb-official-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(7, 26, 18, 0.95));
  border: 1.5px solid var(--accent-emerald, #10B981);
  border-radius: 1rem;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 24px -4px rgba(16, 185, 129, 0.2);
}

.nsb-flag-bar {
  background: var(--accent-emerald, #10B981);
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.nsb-banner-body {
  padding: 1.25rem;
  text-align: center;
}

.nsb-banner-heading {
  font-family: var(--font-display, 'Outfit', sans-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 0.5rem;
}

.nsb-banner-text {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-secondary, #94A3B8);
  margin-bottom: 1rem;
}

.nsb-banner-text strong {
  color: #FFFFFF;
}

.btn-nsb-register {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.875rem 1.25rem;
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  font-family: var(--font-display, 'Outfit', sans-serif);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: 0.75rem;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn-nsb-register:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
}

.btn-nsb-register:active {
  transform: translateY(0);
}

/* Viral Sharing Section */
.viral-share-section {
  background: rgba(7, 26, 18, 0.6);
  border: 1px dashed rgba(245, 158, 11, 0.35);
  border-radius: 0.875rem;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.share-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary, #F8FAFC);
  margin-bottom: 0.875rem;
}

.scorecard-preview-container {
  margin: 1rem auto 1.25rem;
  max-width: 380px;
  text-align: center;
}

.scorecard-preview-canvas {
  width: 100%;
  max-width: 350px;
  max-height: 48vh;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  border-radius: 0.75rem;
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(245, 158, 11, 0.15);
  display: block;
  margin: 0 auto 0.5rem;
  transition: transform 0.2s ease;
}

.scorecard-preview-canvas:hover {
  transform: scale(1.01);
}

.scorecard-preview-caption {
  font-size: 0.76rem;
  color: var(--accent-gold, #F59E0B);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.share-buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.btn-share {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-whatsapp {
  background: #25D366;
  color: #FFFFFF;
}

.btn-whatsapp:hover {
  background: #20BD5A;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
}

.btn-tiktok {
  background: #010101;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: -1px -1px 4px rgba(0, 242, 234, 0.3), 1px 1px 4px rgba(255, 0, 79, 0.3);
}

.btn-tiktok:hover {
  background: #111111;
  transform: translateY(-2px);
  box-shadow: -2px -2px 8px rgba(0, 242, 234, 0.5), 2px 2px 8px rgba(255, 0, 79, 0.5);
}

.btn-facebook {
  background: #1877F2;
  color: #FFFFFF;
}

.btn-facebook:hover {
  background: #166FE5;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.35);
}

.btn-twitter {
  background: #000000;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-twitter:hover {
  background: #1A1A1A;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}

.btn-native-share {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #05140E;
  font-weight: 800;
}

.btn-native-share:hover {
  background: linear-gradient(135deg, #FBBF24, #F59E0B);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.btn-copy-card {
  background: rgba(167, 243, 208, 0.1);
  color: #A7F3D0;
  border: 1px solid rgba(167, 243, 208, 0.25);
}

.btn-copy-card:hover {
  background: rgba(167, 243, 208, 0.18);
  transform: translateY(-2px);
}

.btn-download-card {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold, #F59E0B);
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-weight: 700;
}

.btn-download-card:hover {
  background: rgba(245, 158, 11, 0.28);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}


.share-toast {
  display: inline-block;
  background: rgba(16, 185, 129, 0.95);
  color: #FFFFFF;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 9999px;
  margin-top: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  animation: fadeInToast 0.3s ease;
}

@keyframes fadeInToast {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Lead Capture Box */
.lead-capture-box {
  background: rgba(7, 26, 18, 0.6);
  border: 1px solid rgba(167, 243, 208, 0.15);
  border-radius: 0.875rem;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.lead-heading {
  font-family: var(--font-display, 'Outfit', sans-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-gold, #F59E0B);
  margin-bottom: 0.25rem;
}

.lead-subtext {
  font-size: 0.8rem;
  color: var(--text-muted, #A7F3D0);
  margin-bottom: 1rem;
}

.lead-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: left;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary, #A7F3D0);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group input,
.form-group select {
  padding: 0.65rem 0.85rem;
  background: rgba(5, 20, 14, 0.85);
  border: 1px solid rgba(167, 243, 208, 0.2);
  border-radius: 0.5rem;
  color: var(--text-primary, #F8FAFC);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent-gold, #F59E0B);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.btn-save-score {
  width: 100%;
  padding: 0.75rem;
  background: linear-gradient(135deg, var(--accent-gold, #F59E0B), #D97706);
  color: #071A12;
  font-family: var(--font-display, 'Outfit', sans-serif);
  font-size: 0.9rem;
  font-weight: 800;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

.btn-save-score:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-save-score:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.lead-success {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34D399;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

/* Modal Footer Actions */
.modal-footer-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-modal-action {
  flex: 1;
  padding: 0.8rem;
  border-radius: 0.65rem;
  font-family: var(--font-display, 'Outfit', sans-serif);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-play-again {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
}

.btn-play-again:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-home-hub {
  background: transparent;
  color: var(--text-secondary, #94A3B8);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-home-hub:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #FFFFFF;
}

/* Mobile Responsiveness for Modal */
@media (max-width: 600px) {
  .modal-card {
    padding: 1.5rem 1rem;
  }

  .summary-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .lead-form-grid {
    grid-template-columns: 1fr;
  }

  .form-group.full-width {
    grid-column: span 1;
  }

  .share-buttons-row {
    flex-direction: column;
  }

  .btn-share {
    width: 100%;
    justify-content: center;
  }

  .modal-footer-actions {
    flex-direction: column;
  }
}

/* Pre-Game Speller Entry Modal Additions */
.active-speller-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.active-avatar {
  font-size: 2.2rem;
  background: rgba(245, 158, 11, 0.15);
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.active-info {
  display: flex;
  flex-direction: column;
}

.active-info strong {
  font-size: 1.2rem;
  color: #FFFFFF;
}

.active-info span {
  font-size: 0.85rem;
  color: var(--accent-gold, #F59E0B);
  font-weight: 600;
}

.btn-entry-start {
  width: 100%;
  padding: 0.95rem;
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  font-family: var(--font-display, 'Outfit', sans-serif);
  font-size: 1rem;
  font-weight: 800;
  border: none;
  border-radius: 0.65rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
  transition: all 0.2s ease;
  margin-top: 10px;
}

.btn-entry-start:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
}

.btn-entry-start:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.speller-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #F8FAFC;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
}

.speller-header-badge .btn-switch-speller {
  color: var(--accent-gold, #F59E0B);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 0.78rem;
  font-weight: 700;
}
