/* ==========================================================================
   চিঠি (Chiti) - Native Mobile App Stylesheet
   ========================================================================== */

:root {
  --primary-wood-dark: #2a140b;
  --primary-wood: #4d2614;
  --primary-wood-light: #703c20;
  --gold-accent: #d4af37;
  --gold-accent-light: #f5e8be;
  --gold-shadow: rgba(212, 175, 55, 0.35);
  --parchment-bg: #f5eedc;
  --parchment-card: #f9f5ea;
  --parchment-glass: rgba(248, 242, 230, 0.92);
  --text-dark: #2c1b12;
  --text-gold: #fff5ea;
  --text-muted: #6b5344;
  
  /* Fonts - Authentic Bengali Handwriting & Calligraphy */
  --font-bangla-title: 'Tiro Bangla', serif;
  --font-bangla-ui: 'Hind Siliguri', sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-ornament: 'Cinzel', serif;
  --font-atma: 'Atma', cursive, sans-serif;
  --font-galada: 'Galada', cursive;
  --font-baloo: 'Baloo Da 2', cursive, sans-serif;
  --font-tiro: 'Tiro Bangla', serif;
  --font-mina: 'Mina', sans-serif;
  --font-noto: 'Noto Serif Bengali', serif;
  --font-dancing: 'Dancing Script', cursive;

  /* Inks */
  --ink-blue: #1c3d6e;
  --ink-black: #201f1e;
  --ink-sepia: #4e2912;
  --ink-crimson: #7c1a1a;
  --ink-emerald: #195234;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Reset & Mobile Native Baseline */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: fixed;
  background-color: #f4eee5;
  font-family: var(--font-bangla-ui);
  color: var(--text-dark);
  touch-action: manipulation;
}

/* App Viewport Container */
.app-container {
  position: relative;
  width: 100%;
  max-width: 460px;
  height: 100%;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background-color: #f4eee5;
  box-shadow: 0 0 45px rgba(0, 0, 0, 0.35);
}

/* Screen Management & Smooth Transitions */
.screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
}

.screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
  z-index: 5;
}

/* ==========================================================================
   SCREEN 1: LANDING / HOME SCREEN
   ========================================================================== */

.bg-scene {
  position: absolute;
  inset: 0;
  background-image: url('assets/parchment_paper_desk_scene.jpeg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  transform: scale(1.02);
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
}

.bg-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% 40%, 
    rgba(255, 248, 235, 0.08) 0%, 
    rgba(35, 20, 10, 0.3) 60%, 
    rgba(15, 8, 4, 0.65) 100%
  );
  pointer-events: none;
  z-index: 2;
}

.first-screen {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 12px) 20px calc(var(--safe-bottom) + 20px);
}

.brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: clamp(105px, 18vh, 145px);
  animation: fadeInDown 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.brand-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: rotate(2.8deg) translateX(8px);
  transform-origin: center center;
}

.brand-logo-img {
  width: 170px;
  max-width: 50vw;
  height: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
  filter: sepia(0.55) saturate(2.2) brightness(0.68) contrast(1.08);
  opacity: 0.84;
  transition: transform 0.3s ease;
}

.brand-subtitle {
  font-family: var(--font-bangla-ui);
  font-size: 0.94rem;
  font-weight: 600;
  color: #4a2815;
  margin-top: 3px;
  letter-spacing: 0.6px;
  opacity: 0.82;
  mix-blend-mode: multiply;
}

.center-motif {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: auto 0;
  padding: 0 14px;
  text-align: center;
  transform: rotate(2.8deg) translateX(8px);
  transform-origin: center center;
}

.vintage-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 60%;
  opacity: 0.7;
}

.vintage-divider .line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(90, 46, 25, 0.45), transparent);
}

.vintage-divider .ornament {
  color: var(--primary-wood);
  font-size: 1rem;
}

.home-invite-text {
  font-family: var(--font-tiro);
  font-size: 1.02rem;
  line-height: 1.6;
  font-style: italic;
  font-weight: 500;
  color: #3d2110;
  mix-blend-mode: multiply;
  opacity: 0.88;
  max-width: 270px;
  margin-top: 10px;
  letter-spacing: 0.3px;
  text-shadow: 0 0.5px 0 rgba(255, 255, 255, 0.35);
}

.action-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  transform: rotate(2.8deg) translateX(8px);
  transform-origin: center center;
  animation: fadeInUp 0.9s 0.15s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.btn-primary {
  position: relative;
  width: 100%;
  max-width: 260px;
  height: 48px;
  border-radius: 24px;
  border: 1.5px solid rgba(65, 35, 18, 0.55);
  background: rgba(85, 45, 20, 0.07);
  mix-blend-mode: multiply;
  color: #2c160a;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  outline: none;
  overflow: hidden;
  box-shadow: 
    0 1px 3px rgba(60, 30, 10, 0.12),
    inset 0 0 6px rgba(65, 35, 18, 0.06);
  transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.btn-primary .btn-text {
  font-family: var(--font-bangla-ui);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #2c160a;
  text-shadow: 0 0.5px 0 rgba(255, 255, 255, 0.35);
}

.btn-primary .btn-icon {
  display: flex;
  align-items: center;
  color: #2c160a;
  filter: none;
}

.btn-primary .btn-shine {
  display: none;
}

.btn-primary:hover {
  background: rgba(85, 45, 20, 0.12);
  border-color: rgba(65, 35, 18, 0.75);
}

.btn-primary:active {
  transform: scale(0.97) translateY(1px);
  background: rgba(85, 45, 20, 0.18);
}

.btn-secondary {
  width: auto;
  min-width: 130px;
  height: 34px;
  padding: 0 16px;
  border-radius: 17px;
  border: 1px dashed rgba(80, 45, 20, 0.35);
  background: transparent;
  mix-blend-mode: multiply;
  color: #4a2916;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  box-shadow: none;
  transition: all 0.2s ease;
}

.btn-secondary .btn-text {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: #4a2916;
}

.btn-secondary:hover {
  background: rgba(85, 45, 20, 0.06);
  border-style: solid;
}

.btn-secondary:active {
  transform: scale(0.96);
  opacity: 0.7;
}

.footer-note {
  font-family: var(--font-bangla-ui);
  font-size: 0.82rem;
  font-weight: 500;
  color: #523725;
  letter-spacing: 0.3px;
  opacity: 0.8;
  margin-top: 2px;
}

/* ==========================================================================
   SCREEN 2 & 3: LETTER EDITOR & PREVIEW SCREENS (চিঠি লিখুন ও চিঠি প্রিভিউ)
   ========================================================================== */

#screen-editor, #screen-preview {
  background-color: #f4eee5;
  background-image: radial-gradient(circle at 50% 20%, #faf6f0 0%, #f2ebe0 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 8px) 16px calc(var(--safe-bottom) + 16px);
}

.preview-bottom-bar {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-top: 6px;
  z-index: 10;
}

.read-only-letter {
  cursor: default;
  user-select: text;
  -webkit-user-select: text;
}

/* Navbar */
.editor-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 2px;
  z-index: 10;
}

.nav-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(140, 100, 70, 0.15);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(4px);
  color: #2c1b12;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.nav-btn:active {
  transform: scale(0.92);
  background: rgba(220, 205, 190, 0.6);
}

.editor-nav-title {
  font-family: var(--font-bangla-title);
  font-size: 1.45rem;
  font-weight: 700;
  color: #2c1b12;
  text-shadow: none;
  letter-spacing: 0.5px;
}

/* Paper Viewport & Texture Sheet */
.paper-canvas-viewport {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px 8px;
  overflow: hidden;
  min-height: 0;
}

.parchment-sheet {
  position: relative;
  width: 100%;
  max-width: 400px;
  height: 100%;
  max-height: 520px;
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #ebd9be;
  border-radius: 12px;
  box-shadow: none;
  filter: drop-shadow(0 8px 18px rgba(70, 45, 20, 0.14));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background-image 0.25s ease, transform 0.2s ease;
}

/* Paper Background Variations (.png updated) */
.parchment-sheet.style-blank-vintage {
  background-image: url('assets/parchment_paper_blank_vintage.png');
}
.parchment-sheet.style-lined-plain {
  background-image: url('assets/parchment_paper_lined_plain.png');
}
.parchment-sheet.style-floral-lined {
  background-image: url('assets/parchment_paper_floral_lined.png');
}
.parchment-sheet.style-heart-rose {
  background-image: url('assets/parchment_paper_heart_rose.png');
}
.parchment-sheet.style-blank-texture {
  background-image: url('assets/parchment_paper_blank_texture.png');
}

.paper-inner-layer {
  position: absolute;
  top: 5.5%;
  bottom: 5.5%;
  left: 6.5%;
  right: 6.5%;
  padding: 6px 8px 12px;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(140, 90, 50, 0.25) transparent;
}

.paper-inner-layer::-webkit-scrollbar {
  width: 3px;
}
.paper-inner-layer::-webkit-scrollbar-thumb {
  background: rgba(140, 90, 50, 0.25);
  border-radius: 2px;
}

/* Editable Letter Area */
.letter-textarea {
  width: 100%;
  min-height: 100%;
  outline: none;
  font-size: 1.02rem;
  line-height: 1.62;
  white-space: pre-wrap;
  word-wrap: break-word;
  user-select: text;
  -webkit-user-select: text;
  transition: color 0.3s ease, font-family 0.3s ease, font-size 0.2s ease;
  background: transparent;
}

/* Ink Color Variations */
.letter-textarea.ink-blue {
  color: var(--ink-blue);
  text-shadow: 0 0 0.5px rgba(28, 61, 110, 0.3);
}
.letter-textarea.ink-black {
  color: var(--ink-black);
  text-shadow: 0 0 0.5px rgba(32, 31, 30, 0.3);
}
.letter-textarea.ink-sepia {
  color: var(--ink-sepia);
  text-shadow: 0 0 0.5px rgba(78, 41, 18, 0.3);
}
.letter-textarea.ink-crimson {
  color: var(--ink-crimson);
  text-shadow: 0 0 0.5px rgba(124, 26, 26, 0.3);
}
.letter-textarea.ink-emerald {
  color: var(--ink-emerald);
  text-shadow: 0 0 0.5px rgba(25, 82, 52, 0.3);
}

/* Font Style Variations - Genuine Bengali Handwriting & Script */
.letter-textarea.font-atma { font-family: var(--font-atma); font-weight: 500; font-size: 1.1rem; line-height: 1.7; }
.letter-textarea.font-galada { font-family: var(--font-galada); line-height: 2.1; font-size: 1.05rem; }
.letter-textarea.font-baloo { font-family: var(--font-baloo); font-weight: 500; line-height: 1.7; }
.letter-textarea.font-tiro { font-family: var(--font-tiro); font-style: italic; line-height: 1.75; }
.letter-textarea.font-mina { font-family: var(--font-mina); line-height: 1.75; }
.letter-textarea.font-dancing { font-family: var(--font-dancing); line-height: 1.8; font-size: 1.15rem; }

/* Parchment Variations */
.parchment-sheet.style-envelope-letter {
  background-image: url('assets/vintage_envelope_with_letter.png');
}

/* ==========================================================================
   Editor Popups / Bottom Sheets (Matching Reference Mockups)
   ========================================================================== */

.tool-tray-container {
  position: relative;
  width: 100%;
  z-index: 20;
}

.tool-tray.popup-tray {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  background: #fbf7ee;
  border: 1px solid rgba(180, 150, 120, 0.35);
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(50, 30, 15, 0.18), 0 2px 8px rgba(50, 30, 15, 0.08);
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.97);
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 380px;
  overflow-y: auto;
}

.tool-tray.popup-tray.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.tray-header-title {
  font-family: var(--font-bangla-ui);
  font-size: 1.18rem;
  font-weight: 700;
  color: #2b170c;
  margin-bottom: 12px;
  text-align: left;
}

/* 1. Font Selection List */
.font-list-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.font-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px 4px;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.font-row-item:active {
  background: rgba(140, 100, 70, 0.1);
}

.font-row-lead {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-weight: 700;
  color: #3b2010;
  width: 32px;
  text-align: left;
}

.font-row-name {
  font-size: 0.95rem;
  color: #2c1b12;
  flex: 1;
  text-align: left;
}

.font-row-name.font-atma, .font-row-lead.font-atma { font-family: var(--font-atma); font-weight: 600; font-size: 1.05rem; }
.font-row-name.font-galada, .font-row-lead.font-galada { font-family: var(--font-galada); font-size: 1.05rem; }
.font-row-name.font-baloo, .font-row-lead.font-baloo { font-family: var(--font-baloo); font-weight: 600; }
.font-row-name.font-tiro, .font-row-lead.font-tiro { font-family: var(--font-tiro); font-style: italic; font-weight: 600; }
.font-row-name.font-mina, .font-row-lead.font-mina { font-family: var(--font-mina); font-weight: 600; }
.font-row-name.font-dancing, .font-row-lead.font-dancing { font-family: var(--font-dancing); font-size: 1.15rem; }

.font-check-icon {
  font-size: 1.1rem;
  font-weight: bold;
  color: #2b170c;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.font-row-item.active .font-check-icon {
  opacity: 1;
}

/* 2. Color Grid & Ink Sliders */
.color-grid-8 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 4px 6px 14px;
  justify-items: center;
}

.color-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  outline: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.color-dot:active {
  transform: scale(0.92);
}

.color-dot.active {
  transform: scale(1.15);
  box-shadow: 0 0 0 2px #fbf7ee, 0 0 0 4px #2b170c;
}

.ink-black-pick { background-color: #1c1b1a; }
.ink-blue-pick { background-color: #1a4b8c; }
.ink-navy-pick { background-color: #0e2a4a; }
.ink-green-pick { background-color: #165b33; }
.ink-purple-pick { background-color: #4d3a82; }
.ink-red-pick { background-color: #b8332a; }
.ink-maroon-pick { background-color: #781818; }
.ink-multi-pick {
  background: conic-gradient(from 180deg at 50% 50%, #1a4b8c 0deg, #165b33 90deg, #b8332a 180deg, #4d3a82 270deg, #1a4b8c 360deg);
}

.tray-sub-section {
  border-top: 1px solid rgba(180, 140, 100, 0.2);
  padding-top: 10px;
  margin-top: 4px;
}

.tray-sub-title {
  font-family: var(--font-bangla-ui);
  font-size: 0.92rem;
  font-weight: 600;
  color: #2b170c;
  margin-bottom: 8px;
  text-align: left;
}

.tray-slider-wrap {
  display: flex;
  align-items: center;
  padding: 2px 0;
}

.tray-slider-wrap input[type="range"] {
  width: 100%;
  accent-color: #3b2010;
  cursor: pointer;
}

.calligraphy-preview-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  margin-top: 4px;
}

.calligraphy-stroke-svg {
  width: 100%;
  max-width: 180px;
  height: 32px;
}

/* 3. Paper Grid (2 x 3) */
.paper-grid-6 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding: 2px 2px 6px;
}

.paper-card-thumb {
  height: 72px;
  border-radius: 8px;
  border: 1.5px solid rgba(160, 120, 80, 0.25);
  overflow: hidden;
  cursor: pointer;
  background: #f0e8d8;
  transition: all 0.2s ease;
}

.paper-card-thumb .thumb-img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.2s ease;
}

.paper-card-thumb.active {
  border: 2.5px solid #3b2010;
  box-shadow: 0 3px 10px rgba(50, 30, 15, 0.2);
  transform: scale(1.02);
}

.thumb-img.bg-blank-vintage { background-image: url('assets/parchment_paper_blank_vintage.png'); }
.thumb-img.bg-blank-texture { background-image: url('assets/parchment_paper_blank_texture.png'); }
.thumb-img.bg-lined-plain { background-image: url('assets/parchment_paper_lined_plain.png'); }
.thumb-img.bg-floral-lined { background-image: url('assets/parchment_paper_floral_lined.png'); }
.thumb-img.bg-envelope-letter { background-image: url('assets/vintage_envelope_with_letter.jpeg'); }
.thumb-img.bg-heart-rose { background-image: url('assets/parchment_paper_heart_rose.png'); }

/* 4. Pen Nib Grid */
.pen-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.pen-nib-card {
  height: 126px;
  border-radius: 12px;
  border: 1.5px solid rgba(160, 120, 80, 0.25);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s ease;
}

.pen-img-box {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pen-img {
  max-height: 110px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.pen-nib-card.active {
  border: 2.5px solid #3b2010;
  box-shadow: 0 4px 12px rgba(50, 30, 15, 0.22);
  transform: scale(1.02);
}

/* Bottom Toolbar & Send Button Area */
.editor-bottom-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  z-index: 10;
}

/* Floating Parchment Toolbar (Thick Torn Paper Ribbon) */
.floating-toolbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background-image: url('assets/torn_paper_ribbon_banner.png');
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  background-color: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 16px 28px rgba(45, 25, 10, 0.28)) drop-shadow(0 4px 8px rgba(45, 25, 10, 0.16));
  padding: 26px 20px 24px;
  min-height: 124px;
  box-sizing: border-box;
  margin-top: -14px;
  margin-bottom: 2px;
  z-index: 15;
}

.tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: #3b2010;
  cursor: pointer;
  outline: none;
  padding: 6px 14px;
  border-radius: 10px;
  transition: all 0.2s ease;
  mix-blend-mode: multiply;
}

.tool-btn .tool-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: #2c1b12;
}

.tool-btn .font-symbol {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
}

.tool-btn .tool-label {
  font-family: var(--font-bangla-ui);
  font-size: 0.88rem;
  font-weight: 600;
  color: #381e10;
  line-height: 1.2;
}

.tool-btn.active, .tool-btn:active {
  background: rgba(80, 40, 20, 0.12);
  color: #1f0d04;
  transform: scale(0.96);
}

/* Send Button: চিঠি পাঠান */
.btn-send-action {
  width: 100%;
  height: 52px;
  border-radius: 14px;
  border: none;
  background: #392215;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  outline: none;
  box-shadow: 0 6px 18px rgba(45, 20, 10, 0.28);
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
  margin-top: 4px;
}

.btn-send-action .send-icon {
  color: #ffffff;
  display: flex;
  align-items: center;
}

.btn-send-action .send-text {
  font-family: var(--font-bangla-ui);
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.btn-send-action:active {
  transform: scale(0.98);
  background: #25160d;
}

/* ==========================================================================
   Toast Notification & About Modal
   ========================================================================== */

.send-toast {
  position: absolute;
  top: calc(var(--safe-top) + 20px);
  left: 50%;
  transform: translateX(-50%) translateY(-30px);
  background: rgba(40, 20, 10, 0.94);
  color: var(--text-gold);
  border: 1px solid var(--gold-accent);
  border-radius: 12px;
  padding: 12px 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 50;
  width: 90%;
  max-width: 340px;
}

.send-toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toast-icon {
  font-size: 1.6rem;
}

.toast-text {
  display: flex;
  flex-direction: column;
}

.toast-text strong {
  font-family: var(--font-bangla-ui);
  font-size: 0.95rem;
  color: var(--gold-accent-light);
}

.toast-text span {
  font-size: 0.8rem;
  opacity: 0.85;
}

/* About Modal */
.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: rgba(18, 10, 6, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: #f8f3e6 url('assets/parchment_paper_blank_vintage.png') center/cover no-repeat;
  border-radius: 18px;
  border: 1.5px solid rgba(180, 140, 100, 0.5);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), inset 0 0 40px rgba(160, 110, 70, 0.15);
  padding: 28px 24px 20px;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-dark);
}

.modal-backdrop.active .modal-card {
  transform: scale(1) translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(90, 46, 25, 0.1);
  color: #5a2e19;
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: background 0.2s;
}

.modal-close-btn:active {
  background: rgba(90, 46, 25, 0.25);
}

.modal-header {
  text-align: center;
  margin-bottom: 16px;
}

.modal-stamp {
  display: inline-block;
  font-family: var(--font-bangla-title);
  font-size: 0.9rem;
  font-weight: 700;
  color: #8c3b24;
  border: 1.5px dashed #8c3b24;
  padding: 2px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.modal-title {
  font-family: var(--font-bangla-title);
  font-size: 1.5rem;
  font-weight: 700;
  color: #381c0d;
}

.modal-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.modal-body {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #3b281d;
}

.modal-body p {
  margin-bottom: 14px;
  text-align: justify;
}

.about-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0 18px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 10px;
  border: 1px solid rgba(130, 90, 60, 0.15);
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #4a2d1a;
}

.feature-bullet {
  color: #a85829;
  font-size: 0.85rem;
}

.modal-footer-credits {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #7b5840;
  border-top: 1px solid rgba(130, 90, 60, 0.2);
  padding-top: 10px;
  margin-top: 10px;
}

/* ==========================================================================
   SCREEN 4: SEND LETTER SCREEN (চিঠি পাঠান)
   ========================================================================== */

#screen-send {
  background-color: #f4eee5;
  background-image: radial-gradient(circle at 50% 20%, #faf6f0 0%, #f2ebe0 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 8px) 16px calc(var(--safe-bottom) + 16px);
}

.send-envelope-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 12px 20px;
}

.envelope-hero-wrap {
  width: 100%;
  max-width: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  animation: floatSubtle 4s ease-in-out infinite;
}

.envelope-hero-img {
  width: 100%;
  max-width: 290px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 14px 28px rgba(70, 45, 20, 0.16));
}

.send-caption-box {
  text-align: center;
  margin-top: 28px;
  padding: 0 10px;
}

.send-caption-line1 {
  font-family: var(--font-bangla-ui);
  font-size: 1.12rem;
  font-weight: 600;
  color: #3b2214;
  line-height: 1.5;
}

.send-caption-line2 {
  font-family: var(--font-bangla-ui);
  font-size: 1.05rem;
  font-weight: 500;
  color: #55331e;
  line-height: 1.5;
  margin-top: 2px;
}

.send-bottom-bar {
  width: 100%;
  margin-top: 8px;
  z-index: 10;
}

.envelope-hero-wrap.sending-animation {
  transform: translateY(-40px) scale(0.85) rotate(-3deg);
  opacity: 0.6;
  filter: drop-shadow(0 25px 35px rgba(50, 25, 10, 0.35));
}

/* ==========================================================================
   CONFIRMATION SCREEN (পাঠানো হয়েছে)
   ========================================================================== */

#screen-confirmation {
  background-color: #f4eee5;
  background-image: radial-gradient(circle at 50% 20%, #faf6f0 0%, #f2ebe0 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 12px) 20px calc(var(--safe-bottom) + 24px);
}

.confirm-navbar {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  width: 100%;
}

.confirm-nav-title {
  font-family: var(--font-bangla-title);
  font-size: 1.4rem;
  font-weight: 700;
  color: #3b2214;
  letter-spacing: 0.5px;
}

.confirm-body-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 16px 20px;
}

.success-badge-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}

.success-badge-outer {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(116, 168, 81, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(116, 168, 81, 0.38);
  animation: pulseSoft 3s infinite ease-in-out;
}

.success-badge-inner {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(145deg, #74a851, #5b8e39);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(91, 142, 57, 0.35), inset 0 2px 3px rgba(255, 255, 255, 0.45);
}

.checkmark-icon {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.confirm-text-box {
  text-align: center;
}

.confirm-text-line1 {
  font-family: var(--font-bangla-ui);
  font-size: 1.15rem;
  font-weight: 600;
  color: #3b2214;
  line-height: 1.5;
}

.confirm-text-line2 {
  font-family: var(--font-bangla-ui);
  font-size: 1.15rem;
  font-weight: 600;
  color: #3b2214;
  line-height: 1.5;
  margin-top: 2px;
}

.confirm-actions-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 0 4px 8px;
}

.btn-confirm-secondary {
  width: 100%;
  max-width: 320px;
  height: 50px;
  border-radius: 12px;
  border: 1px solid rgba(180, 150, 120, 0.4);
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #3b2214;
  font-family: var(--font-bangla-ui);
  font-size: 1.12rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  box-shadow: 0 2px 10px rgba(70, 45, 20, 0.07);
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-confirm-secondary:active {
  transform: scale(0.97);
  background: rgba(240, 230, 215, 0.85);
}

.btn-confirm-text {
  background: transparent;
  border: none;
  outline: none;
  color: #3b2214;
  font-family: var(--font-bangla-ui);
  font-size: 1.08rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 20px;
  transition: opacity 0.2s ease;
  letter-spacing: 0.3px;
}

.btn-confirm-text:active {
  opacity: 0.6;
}

@keyframes pulseSoft {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.85; }
}

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

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes shineLoop {
  0%, 65% { left: -75%; }
  100% { left: 140%; }
}



