/* ═══════════════════════════════════════════════════════════════════
   Facebook Profile Frame App — style.css
   Mobile-first, responsive, Bangla + English bilingual
═══════════════════════════════════════════════════════════════════ */

/* ── TOKENS ─────────────────────────────────────────────────────── */
:root {
  --blue:        #1877F2;   /* Facebook blue */
  --blue-dark:   #0d5fca;
  --blue-soft:   #E7F0FD;
  --blue-mid:    #3b82f6;
  --green:       #16a34a;
  --green-dark:  #15803d;
  --white:       #ffffff;
  --grey-bg:     #F3F4F6;
  --grey-light:  #E5E7EB;
  --grey-mid:    #9CA3AF;
  --grey-text:   #374151;
  --dark:        #111827;
  --red:         #DC2626;

  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   20px;

  --shadow-sm:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 16px rgba(0,0,0,.10), 0 1px 4px rgba(0,0,0,.06);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.13);

  --font:        'Hind Siliguri', 'Segoe UI', Arial, sans-serif;
  --max-w:       520px;
  --transition:  0.2s ease;
}

/* ── RESET ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--grey-bg);
  color: var(--grey-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font); border: none; background: none; }
a { color: inherit; text-decoration: none; }

/* ── UTILITY ─────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.en { font-size: 0.82em; color: var(--grey-mid); display: block; }

/* ── HEADER ──────────────────────────────────────────────────────── */
.site-header {
  background: var(--blue);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(24,119,242,.35);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-logo {
  color: var(--white);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
}

/* ── MAIN ────────────────────────────────────────────────────────── */
.main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── HERO ────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 8px 0 0;
}
.hero-title {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.3;
  margin-bottom: 10px;
}
.hero-title .hero-sub {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--grey-mid);
  margin-top: 4px;
}
.hero-desc {
  font-size: 0.97rem;
  line-height: 1.6;
  color: var(--grey-text);
}

/* ── STEPPER ─────────────────────────────────────────────────────── */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.step-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--grey-light);
  color: var(--grey-mid);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition),
              box-shadow var(--transition);
}
.step.active .step-dot {
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 0 0 4px var(--blue-soft);
}
.step.done .step-dot {
  background: var(--green);
  color: var(--white);
}
.step-label {
  font-size: 0.72rem;
  text-align: center;
  line-height: 1.3;
  color: var(--grey-mid);
}
.step.active .step-label { color: var(--blue); font-weight: 600; }
.step.done .step-label   { color: var(--green); }
.step-line {
  flex: 1;
  height: 2px;
  background: var(--grey-light);
  margin: 0 8px;
  margin-bottom: 22px;
  max-width: 60px;
  transition: background var(--transition);
}
.step-line.done { background: var(--green); }

/* ── CARD ────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* ── UPLOAD ZONE ─────────────────────────────────────────────────── */
.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  cursor: pointer;
  border: 2.5px dashed var(--grey-light);
  border-radius: var(--radius-lg);
  margin: 12px;
  transition: border-color var(--transition), background var(--transition);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.upload-zone:hover,
.upload-zone:focus,
.upload-zone.drag-over {
  border-color: var(--blue);
  background: var(--blue-soft);
  outline: none;
}
.upload-icon {
  width: 72px;
  height: 72px;
  margin-bottom: 16px;
}
.upload-main {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}
.upload-sub {
  font-size: 0.88rem;
  color: var(--grey-mid);
  margin-bottom: 10px;
}
.upload-hint {
  font-size: 0.75rem;
  color: var(--grey-mid);
  text-align: center;
}
#fileInput { display: none; }

/* ── CANVAS WRAP ─────────────────────────────────────────────────── */
.canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--grey-bg);
  overflow: hidden;
}
#mainCanvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.canvas-loading {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--grey-text);
}

/* ── SPINNER ─────────────────────────────────────────────────────── */
.spinner {
  width: 40px;
  height: 40px;
  border: 3.5px solid var(--blue-soft);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── ACTION BUTTONS ──────────────────────────────────────────────── */
.action-row {
  display: flex;
  gap: 12px;
  padding: 16px;
}
.btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 12px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  transition: transform var(--transition), box-shadow var(--transition),
              background var(--transition), opacity var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.btn svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}
.btn span { text-align: left; }
.btn small {
  font-size: 0.72rem;
  font-weight: 400;
  opacity: 0.85;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn:not(:disabled):active {
  transform: scale(0.97);
}

/* Download — green */
.btn-download {
  background: var(--green);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(22,163,74,.30);
}
.btn-download:not(:disabled):hover {
  background: var(--green-dark);
  box-shadow: 0 4px 14px rgba(22,163,74,.40);
}

/* Facebook — blue */
.btn-facebook {
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(24,119,242,.30);
}
.btn-facebook:not(:disabled):hover {
  background: var(--blue-dark);
  box-shadow: 0 4px 14px rgba(24,119,242,.40);
}

/* Change photo link */
.change-photo-wrap {
  text-align: center;
  padding: 0 16px 16px;
}
.btn-link {
  font-size: 0.85rem;
  color: var(--blue);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.btn-link:hover { color: var(--blue-dark); }

/* ── HOW IT WORKS ────────────────────────────────────────────────── */
.how-section {
  text-align: center;
}
.how-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 16px;
}
.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.how-item {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 18px 10px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.how-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.how-text {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--grey-text);
}

/* ── PRIVACY NOTE ────────────────────────────────────────────────── */
.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.privacy-note svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--green);
  margin-top: 2px;
}
.privacy-note p {
  font-size: 0.82rem;
  line-height: 1.55;
  color: #064e3b;
}

/* ── FOOTER ──────────────────────────────────────────────────────── */
.site-footer {
  background: var(--dark);
  color: var(--grey-mid);
  text-align: center;
  font-size: 0.82rem;
  padding: 18px 16px;
}

/* ── TOAST ───────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark);
  color: var(--white);
  padding: 12px 22px;
  border-radius: 40px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  text-align: center;
  animation: toastIn 0.25s ease;
}
.toast.error { background: var(--red); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── TABLET ──────────────────────────────────────────────────────── */
@media (min-width: 600px) {
  .main { padding: 32px 24px 64px; gap: 24px; }
  .hero-title { font-size: 1.85rem; }
  .how-text { font-size: 0.87rem; }
  .btn { font-size: 1rem; padding: 16px 14px; }
  .btn svg { width: 24px; height: 24px; }
}

/* ── DESKTOP ─────────────────────────────────────────────────────── */
@media (min-width: 1024px) {
  .main { padding: 40px 0 80px; gap: 28px; }
  .card:hover { box-shadow: var(--shadow-lg); }
  .upload-zone { padding: 56px 32px; }
}

/* ── REDUCED MOTION ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   ASUT-SPECIFIC ADDITIONS
═══════════════════════════════════════════════════════════════════ */

/* ── EVENT BANNER ────────────────────────────────────────────────── */
.event-banner {
  background: linear-gradient(135deg, #1a237e 0%, #1565c0 60%, #1877F2 100%);
  color: #fff;
  padding: 12px 16px;
}
.event-banner-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.event-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}
.event-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.event-date {
  font-size: 0.82rem;
  opacity: 0.92;
  line-height: 1.4;
}
.event-date-en {
  font-size: 0.75rem;
  opacity: 0.75;
}

/* ── HEADER BILINGUAL ────────────────────────────────────────────── */
.header-en {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.header-bn {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: rgba(255,255,255,0.78);
  margin-top: 2px;
}

/* ── CAPTION PREVIEW CARD ────────────────────────────────────────── */
.caption-card {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 18px 18px 14px;
  border-left: 4px solid var(--blue);
}
.caption-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.caption-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--dark);
  font-weight: 500;
  margin-bottom: 10px;
}
.caption-note {
  font-size: 0.78rem;
  color: var(--grey-mid);
  line-height: 1.5;
}

/* ── FOOTER ASUT ─────────────────────────────────────────────────── */
.footer-org {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}
.footer-org-en {
  font-size: 0.8rem;
  color: var(--grey-mid);
  margin-bottom: 10px;
}
.footer-fb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #90CAF9;
  font-size: 0.82rem;
  margin-bottom: 10px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer-fb:hover { color: #fff; }
.footer-copy {
  font-size: 0.75rem;
  color: var(--grey-mid);
}

/* ═══════════════════════════════════════════════════════════════════
   DRAG & ZOOM ADDITIONS
═══════════════════════════════════════════════════════════════════ */

/* ── DRAG HINT ───────────────────────────────────────────────────── */
.drag-hint {
  background: linear-gradient(90deg, var(--blue) 0%, #1565c0 100%);
  color: #fff;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 9px 16px;
  letter-spacing: 0.01em;
  animation: pulseHint 2s ease-in-out 1;
}
@keyframes pulseHint {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.75; }
}

/* ── CANVAS CURSOR ───────────────────────────────────────────────── */
#mainCanvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;   /* prevent browser scroll interfering with drag */
  cursor: grab;
}
#mainCanvas:active { cursor: grabbing; }

/* ── ZOOM ROW ────────────────────────────────────────────────────── */
.zoom-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px 4px;
  border-top: 1px solid var(--grey-light);
}
.zoom-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--grey-bg);
  border: 1.5px solid var(--grey-light);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--grey-text);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font);
}
.zoom-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.zoom-btn:hover  { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }
.zoom-btn:active { transform: scale(0.95); }
.zoom-reset      { background: #FFF3E0; border-color: #FFB74D; color: #E65100; }
.zoom-reset:hover{ background: #FFE0B2; border-color: #FF8F00; }

.zoom-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--grey-text);
  min-width: 42px;
  text-align: center;
  font-family: monospace;
}
