/* ==========================================================================
   Noah's Confirmation & Author Gift Webpage - Stylesheet
   ========================================================================== */

:root {
  --bg-dark: #090d16;
  --bg-card: rgba(18, 26, 43, 0.85);
  --bg-card-border: rgba(212, 175, 55, 0.25);
  
  --gold-primary: #d4af37;
  --gold-light: #f9e79f;
  --gold-dark: #aa820a;
  --gold-gradient: linear-gradient(135deg, #bf953f 0%, #fcf6ba 25%, #b38728 50%, #fbf5b7 75%, #aa771c 100%);
  --gold-glow: 0 0 25px rgba(212, 175, 55, 0.4);

  --parchment-bg: #fcf9f0;
  --parchment-text: #2c221e;
  --parchment-border: #e2d7c3;

  --navy-deep: #0b132b;
  --navy-accent: #1c2541;
  --accent-blue: #3a506b;
  --accent-ruby: #721c24;

  --text-main: #f0f4f8;
  --text-muted: #a0aec0;

  --font-serif: 'Playfair Display', 'Georgia', serif;
  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
  
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 15px rgba(212, 175, 55, 0.15);
}

/* Base resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Background Animated Canvas & Shimmer */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

.bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 50% 15%, rgba(212, 175, 55, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(28, 37, 65, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 20% 70%, rgba(11, 19, 43, 0.5) 0%, transparent 50%);
  z-index: -1;
  pointer-events: none;
}

/* Container */
.main-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

/* Typography Helpers */
.serif-header {
  font-family: var(--font-serif);
  letter-spacing: -0.02em;
}

.gold-text {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Card Base */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gold-gradient);
}

/* ==========================================================================
   Section 1: Hero Banner & Scripture
   ========================================================================== */
.hero-section {
  text-align: center;
  position: relative;
  padding: 3rem 1.5rem 2rem;
}

.faith-symbol {
  width: 90px;
  height: 90px;
  margin: 0 auto 1.5rem;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.church-logo-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold-primary);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.6), inset 0 0 10px rgba(0, 0, 0, 0.5);
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--gold-light);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.4rem 1.2rem;
  border-radius: 50px;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 2rem;
}

/* Scripture Box */
.scripture-card {
  background: rgba(11, 19, 43, 0.6);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-md);
  padding: 1.75rem 2rem;
  max-width: 750px;
  margin: 0 auto;
  position: relative;
}

.scripture-quote {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-style: italic;
  color: #e2e8f0;
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.scripture-ref {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--gold-light);
  text-transform: uppercase;
}

/* ==========================================================================
   Section 2: Parchment Letter Card
   ========================================================================== */
.letter-card {
  background: var(--parchment-bg);
  color: var(--parchment-text);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), inset 0 0 80px rgba(212, 175, 55, 0.08);
  border: 2px solid var(--parchment-border);
  position: relative;
}

.letter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid rgba(44, 34, 30, 0.12);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

.letter-salutation {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a120e;
}

.letter-icon {
  width: 32px;
  height: 32px;
  opacity: 0.8;
}

.letter-body {
  font-size: 1.1rem;
  line-height: 1.85;
  color: #382a24;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.letter-body p {
  text-indent: 1.5rem;
}

.letter-body p:first-of-type {
  text-indent: 0;
}

.letter-body p:first-of-type::first-letter {
  font-family: var(--font-serif);
  font-size: 3.2rem;
  float: left;
  line-height: 0.85;
  margin-right: 0.5rem;
  color: #8c6211;
  font-weight: 700;
}

.letter-signature {
  margin-top: 2.5rem;
  text-align: right;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.35rem;
  color: #1a120e;
  font-weight: 600;
}

.edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px dashed rgba(44, 34, 30, 0.3);
  color: #6b5246;
  font-size: 0.85rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.edit-btn:hover {
  background: rgba(44, 34, 30, 0.05);
  color: #1a120e;
  border-color: rgba(44, 34, 30, 0.6);
}

/* ==========================================================================
   Section 3: Interactive Envelope & Gift Reveal
   ========================================================================== */
.gift-reveal-section {
  text-align: center;
}

.section-heading {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.section-subtext {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* Envelope Container */
.envelope-wrapper {
  perspective: 1000px;
  max-width: 500px;
  margin: 0 auto;
  cursor: pointer;
}

.envelope-card {
  background: linear-gradient(145deg, #1c2541 0%, #0b132b 100%);
  border: 2px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), var(--gold-glow);
  position: relative;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.envelope-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.7), 0 0 35px rgba(212, 175, 55, 0.5);
}

.wax-seal {
  width: 80px;
  height: 80px;
  background: radial-gradient(circle at 30% 30%, #ffd700, #b8860b);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.5);
  border: 3px solid #fcf6ba;
  animation: pulse-seal 2.5s infinite ease-in-out;
}

.wax-seal svg {
  width: 42px;
  height: 42px;
  fill: #3a2200;
}

.envelope-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--gold-light);
}

.envelope-hint {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.btn-gold {
  background: var(--gold-gradient);
  color: #1a120e;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0.9rem 2.2rem;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-gold:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.6);
  filter: brightness(1.08);
}

.btn-gold:active {
  transform: scale(0.98);
}

/* ==========================================================================
   Section 4: The Revealed Author Masterclass Voucher Ticket
   ========================================================================== */
.voucher-container {
  display: none; /* hidden until revealed */
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.voucher-container.active {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.golden-ticket {
  background: linear-gradient(135deg, #182238 0%, #0d1527 100%);
  border: 2px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(212, 175, 55, 0.3);
  position: relative;
}

.ticket-header {
  background: var(--gold-gradient);
  color: #1a120e;
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
}

.ticket-brand {
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 3.8vw, 1.35rem);
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  word-break: break-word;
}

.ticket-pass-id {
  font-size: 0.75rem;
  background: rgba(26, 18, 14, 0.15);
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.ticket-body {
  padding: 1.75rem 1.25rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

@media (min-width: 768px) {
  .ticket-body {
    padding: 2.5rem 2rem;
    grid-template-columns: 2fr 1fr;
  }
}

.ticket-main-info {
  text-align: left;
  min-width: 0; /* Prevents flex/grid child overflow */
}

.ticket-title {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 4.5vw, 1.85rem);
  color: #fff;
  margin-bottom: 0.5rem;
  line-height: 1.25;
  word-wrap: break-word;
}

.ticket-desc {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.ticket-specs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  background: rgba(11, 19, 43, 0.6);
  border: 1px solid rgba(212, 175, 55, 0.2);
  padding: 1rem;
  border-radius: var(--radius-md);
}

.spec-item {
  display: flex;
  flex-direction: column;
}

.spec-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.spec-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-top: 0.2rem;
}

/* Authors List / Options Selector inside Ticket */
.authors-selection-box {
  background: rgba(11, 19, 43, 0.8);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 1.5rem;
  text-align: left;
}

.authors-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--gold-light);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sponsor-note {
  background: rgba(212, 175, 55, 0.1);
  border-left: 3px solid var(--gold-primary);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
  color: #e2e8f0;
  line-height: 1.55;
}

.sponsor-note strong {
  color: var(--gold-light);
}

.author-options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.author-option-card {
  background: rgba(28, 37, 65, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.25 ease;
  text-decoration: none;
  color: inherit;
}

.author-option-card:hover {
  background: rgba(28, 37, 65, 0.95);
  border-color: var(--gold-primary);
  transform: translateX(4px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.author-info h4 {
  font-size: 1.05rem;
  color: #fff;
  font-weight: 700;
}

.author-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.price-tag {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--gold-light);
  font-weight: 600;
  margin-top: 0.35rem;
  background: rgba(212, 175, 55, 0.12);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  border: 1px solid rgba(212, 175, 55, 0.25);
}

.card-action-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-end;
}

@media (max-width: 600px) {
  .main-container {
    padding: 1.25rem 0.75rem;
    gap: 2rem;
  }
  .glass-card {
    padding: 1.5rem 1rem;
  }
  .letter-card {
    padding: 1.75rem 1.15rem;
  }
  .scripture-card {
    padding: 1rem 0.85rem;
  }
  .scripture-quote {
    font-size: 1.05rem;
  }
  .ticket-body {
    padding: 1.25rem 0.85rem;
  }
  .author-option-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem;
  }
  .card-action-links {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-start;
  }
}

.link-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.link-icon-btn.highlight {
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-light);
  border-color: rgba(212, 175, 55, 0.4);
  font-weight: 700;
}

.link-icon-btn:hover {
  background: var(--gold-gradient);
  color: #1a120e;
  border-color: transparent;
}

/* Ticket Side Stub / Actions */
.ticket-side-stub {
  border-top: 2px dashed rgba(212, 175, 55, 0.3);
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

@media (min-width: 768px) {
  .ticket-side-stub {
    border-top: none;
    border-left: 2px dashed rgba(212, 175, 55, 0.3);
    padding-top: 0;
    padding-left: 1.5rem;
  }
}

.barcode-graphic {
  width: 100%;
  max-width: 180px;
  height: 50px;
  background: repeating-linear-gradient(
    90deg,
    #fff 0,
    #fff 3px,
    transparent 3px,
    transparent 7px,
    #fff 7px,
    #fff 11px,
    transparent 11px,
    transparent 13px,
    #fff 13px,
    #fff 18px
  );
  opacity: 0.85;
  border-radius: 4px;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-main);
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--gold-light);
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Modal for Editing Letter */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.active {
  display: flex;
}

.modal-box {
  background: #1c2541;
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-box h3 {
  font-family: var(--font-serif);
  color: var(--gold-light);
  font-size: 1.4rem;
}

.modal-box textarea {
  width: 100%;
  height: 200px;
  background: rgba(11, 19, 43, 0.8);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: #fff;
  padding: 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 1rem;
  resize: vertical;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ==========================================================================
   Animations & Print Styles
   ========================================================================== */
@keyframes pulse-glow {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.15); opacity: 1; filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.8)); }
}

@keyframes pulse-seal {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  
  #bg-canvas, .bg-overlay, .envelope-wrapper, .edit-btn, .action-buttons, footer, .badge-tag {
    display: none !important;
  }

  .main-container {
    max-width: 100% !important;
    padding: 0 !important;
    gap: 2rem !important;
  }

  .glass-card, .scripture-card, .golden-ticket {
    background: none !important;
    border: 1px solid #ccc !important;
    color: #000 !important;
    box-shadow: none !important;
  }

  .gold-text, .ticket-title, .scripture-ref, .authors-title {
    color: #000 !important;
    -webkit-text-fill-color: initial !important;
    background: none !important;
  }

  .letter-card {
    border: 1px solid #999 !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  .voucher-container {
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
