* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

:root {
  --navy: #0d1b3e;
  --navy-mid: #162147;
  --gold: #F7941D;
  --cream: #f5f0e8;
  --gold-light: #F7941D;
  --white: #ffffff;
}

body {
  font-family: 'Lato', sans-serif;
  background: #1a1a2e;
  display: flex;
  justify-content: center;
  padding: 20px 8px;
}

.poster {
  width: 100%;
  max-width: 900px;
  background: var(--cream);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

/* HEADER */
.header {
  display: flex;
  background: var(--navy);
  position: relative;
}

.logo-wrap { padding: 16px 20px; }

.logo-img {
  height: 90px;
  background: #fff;
  padding: 4px;
  border-radius: 6px;
}

.hero {
  flex: 1;
  text-align: center;
  padding: 24px;
  background: linear-gradient(160deg, var(--navy), #1a2a5e);
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(26px, 5vw, 46px);
  font-weight: 900;
  color: #fff;
}

.hero-title span { color: var(--gold); }

.hero-sub {
  color: rgba(255, 255, 255, .75);
  margin-top: 6px;
  font-style: italic;
  font-size: 14px;
}

.intro {
  background: linear-gradient(90deg, var(--gold), #ffb347, var(--gold));
  padding: 12px 20px;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  color: var(--navy);
  font-size: 14px;
  text-align: center;
}

.wrapper { padding: 24px 30px; }

h2 {
  font-family: 'Playfair Display', serif;
  color: var(--navy);
  font-size: 20px;
  margin-bottom: 12px;
}

/* ── DEDICATION BANNER — always-visible honoree name/photo/purpose ── */
.dedication-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-left: 6px solid var(--gold);
  border-radius: 8px;
  padding: 18px 22px;
  margin-bottom: 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

/* Frame (fixed size/border/shape) is a separate element from the <img>
   itself so the photo can be zoomed/panned via object-position + transform
   on the img without the frame's border/border-radius/box-shadow scaling
   along with it — see the admin's photo-position controls. */
.dedication-photo-frame {
  width: 84px;
  height: 84px;
  border-radius: 12px;
  border: 3px solid var(--gold);
  flex-shrink: 0;
  background: var(--cream);
  overflow: hidden;
}

.dedication-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dedication-text .dedication-label {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-light);
  font-weight: 900;
  margin-bottom: 4px;
}

.dedication-text .dedication-name {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  color: var(--navy);
  font-weight: 900;
  line-height: 1.2;
}

.dedication-text .dedication-purpose {
  font-size: 14px;
  color: #555;
  margin-top: 4px;
}

/* ── DEDICATION OCCASION CAPTION — small icon+label line, only shown when
   the program's purpose matches one of the five themed occasions below.
   Hidden (empty) by default so it doesn't appear for a plain/unthemed
   dedication. ── */
.dedication-occasion {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

/* ── OCCASION THEMES — auto-applied to .dedication-banner based on the
   program's purpose text (see classifyOccasionTheme in index.html). Each
   is an original, CSS-only treatment in the spirit of the reference mood
   board (floral memorial frame / birthday balloons / anniversary bokeh /
   newborn congratulations / Ik Onkar for Sukh Shanti) rather than a copy
   of any specific stock template art. ── */

/* 1. Salana Yaad / Barsi — memorial */
.dedication-banner.theme-memorial {
  background: linear-gradient(135deg, #fbf6ef 0%, #f3e6da 100%);
  border-left-color: #b08d57;
  box-shadow: 0 4px 14px rgba(176, 141, 87, 0.15);
}
.theme-memorial .dedication-occasion { color: #8a4a3c; font-style: italic; font-family: 'Playfair Display', serif; }
.theme-memorial .dedication-photo-frame { border-color: #b08d57; box-shadow: 0 0 0 4px #f3e6da; }
.theme-memorial .dedication-text .dedication-name { color: #6b3a2e; }

/* 2. Birthday */
.dedication-banner.theme-birthday {
  background:
    radial-gradient(circle at 12% 20%, rgba(247,148,29,0.18) 0 7px, transparent 8px),
    radial-gradient(circle at 92% 15%, rgba(214,40,40,0.15) 0 6px, transparent 7px),
    radial-gradient(circle at 85% 85%, rgba(247,148,29,0.18) 0 8px, transparent 9px),
    linear-gradient(135deg, #fff8ec 0%, #ffedcf 100%);
  border-left-color: var(--gold);
}
.theme-birthday .dedication-occasion { color: #b3660a; }
.theme-birthday .dedication-photo-frame { box-shadow: 0 0 0 4px #ffe6ad; }

/* 3. New Born Baby */
.dedication-banner.theme-newborn {
  background: linear-gradient(135deg, #eef6fb 0%, #fdeef1 100%);
  border-left-color: #e3a1b5;
}
.theme-newborn .dedication-occasion { color: #b5607e; }
.theme-newborn .dedication-photo-frame { border-radius: 20px; border-color: #e3a1b5; box-shadow: 0 0 0 4px #fdeef1; }

/* 4. Marriage Anniversary */
.dedication-banner.theme-anniversary {
  background:
    radial-gradient(circle at 15% 25%, rgba(255,215,150,0.35) 0 10px, transparent 11px),
    radial-gradient(circle at 88% 20%, rgba(255,180,180,0.35) 0 8px, transparent 9px),
    radial-gradient(circle at 75% 80%, rgba(255,215,150,0.35) 0 9px, transparent 10px),
    linear-gradient(135deg, #fff3e6 0%, #ffe1e6 100%);
  border-left-color: #c9866b;
}
.theme-anniversary .dedication-occasion { color: #9c4a34; }
.theme-anniversary .dedication-photo-frame { box-shadow: 0 0 0 4px #ffd9c2; }

/* 5. Sukh Shanti of Family — spiritual, dark navy with the site's own gold
   Ik Onkar watermark rather than any downloaded template art. */
.dedication-banner.theme-sukhshanti {
  background:
    linear-gradient(135deg, rgba(13,27,62,0.94) 0%, rgba(22,33,71,0.94) 100%),
    url('../../pictures/00-index/01-ek-onkar.png');
  background-size: cover, 160px;
  background-position: center, center right -20px;
  background-repeat: no-repeat, no-repeat;
  border-left-color: var(--gold);
}
.theme-sukhshanti .dedication-occasion { color: var(--gold); }
.theme-sukhshanti .dedication-text .dedication-name,
.theme-sukhshanti .dedication-text .dedication-purpose { color: #fff; }
.theme-sukhshanti .dedication-text .dedication-purpose { color: rgba(255,255,255,0.75); }
.theme-sukhshanti .dedication-photo-frame { box-shadow: 0 0 0 4px rgba(247,148,29,0.35); }

/* ── MARQUEE — fixed top-right ticker with photo + scrolling name/purpose ── */
.akhand-marquee {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(13, 27, 62, 0.92);
  border: 1px solid var(--gold);
  border-radius: 24px;
  padding: 6px 14px 6px 6px;
  max-width: 320px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.akhand-marquee img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  border: 2px solid var(--gold);
  flex-shrink: 0;
}

.akhand-marquee-track {
  overflow: hidden;
  width: 220px;
}

.akhand-marquee-track span {
  display: inline-block;
  white-space: nowrap;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding-left: 100%;
  animation: akhand-scroll 14s linear infinite;
}

@keyframes akhand-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

@media (max-width: 640px) {
  .akhand-marquee { max-width: 200px; padding: 4px 10px 4px 4px; }
  .akhand-marquee-track { width: 130px; }
  .akhand-marquee img { width: 26px; height: 26px; }
}

/* ── STATUS BAR (scheduled / live / completed) ── */
.status-bar {
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.status-bar.live { background: #e6f7ec; color: #146c3a; border: 1px dashed #146c3a; }
.status-bar.scheduled { background: #fff7e6; color: #8a5a00; border: 1px dashed #8a5a00; }
.status-bar.completed { background: #eef0f5; color: var(--navy); border: 1px dashed var(--navy); }

/* VIDEO PLAYER — dimensions live on #youtube-player itself via aspect-ratio,
   same as the working Sehaj Path page, rather than a parent padding-bottom
   trick: the YT IFrame API measures the target element's real size at the
   moment it initializes, and a height:0 ancestor (the old padding-bottom
   hack) gave it 0 to work with, producing an iframe with no visible height
   even though the video kept playing (audible, not visible). */
.video-container {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
  border: 3px solid var(--gold);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
  background: var(--navy);
  overflow: hidden;
}

#youtube-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  border: none;
  display: block;
}

.video-fallback {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  color: #ffcf8a;
  background: #1a1a2e;
  font-size: 14px;
  line-height: 1.6;
}

/* Used once the plain-iframe fallback is actually playing underneath — a small
   non-blocking banner instead of an opaque full-cover overlay, so the video stays visible. */
.video-fallback.video-fallback-note {
  top: auto;
  bottom: 0;
  padding: 8px 14px;
  background: rgba(13, 27, 62, 0.85);
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
}

/* FORM CONTROLS */
input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: 'Lato', sans-serif;
  font-size: 15px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  background: #fff;
  color: var(--navy);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(247, 148, 29, 0.15);
}

label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.form-row { margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* BUTTONS */
.btn-action, .btn-back, .btn-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: 'Lato', sans-serif;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--navy);
  background: linear-gradient(135deg, var(--gold-light) 0%, #e8830a 100%);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 120, 0.5),
    inset 0 -2px 0 rgba(0, 0, 0, 0.2),
    0 0 0 2px #9a5800,
    0 0 0 3.5px var(--gold);
  transition: filter 0.15s, transform 0.1s;
}

.btn-action { font-size: 12px; padding: 12px 20px; width: 100%; }
.btn-back { font-size: 10px; padding: 9px 16px; }
.btn-control { font-size: 11px; padding: 10px 16px; }

.btn-action:hover, .btn-back:hover, .btn-control:hover { filter: brightness(1.08); }
.btn-action:active, .btn-back:active, .btn-control:active { transform: scale(0.97); filter: brightness(0.93); }
.btn-back svg, .btn-action svg { width: 12px; height: 12px; }

.btn-secondary {
  background: #fff;
  color: var(--navy);
  border: 1px solid rgba(0,0,0,0.15);
  box-shadow: none;
}
.btn-secondary:hover { background: #f5f0e8; }

.btn-danger {
  background: linear-gradient(135deg, #e05252 0%, #b32020 100%);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,150,150,0.4),
    inset 0 -2px 0 rgba(0,0,0,0.2),
    0 0 0 2px #7a1414,
    0 0 0 3.5px #b32020;
}

/* TABLE (records / attendance) */
.table-container {
  width: 100%;
  overflow-x: auto;
  background: var(--white);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th, td { padding: 10px 14px; border-bottom: 1px solid #e0e0e0; }
th {
  background-color: var(--navy-mid);
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1px;
}
tr:hover { background-color: #f9f6f0; }

.loading-text, .no-data {
  text-align: center;
  padding: 18px;
  font-weight: 700;
  color: var(--navy);
}

.badge {
  background: var(--gold);
  color: var(--navy);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 11px;
}

.card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-left: 5px solid var(--gold);
  border-radius: 6px;
  padding: 16px 18px;
  margin-bottom: 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.card-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  color: var(--navy);
  font-size: 15px;
  margin-bottom: 8px;
}

.muted { color: #777; font-size: 13px; }

.nav-link-wrap { text-align: center; margin-top: 10px; }
.nav-link { font-size: 13px; color: var(--navy); text-decoration: underline; font-weight: 700; }
.nav-link:hover { color: var(--gold); }

/* FOOTER */
.footer {
  background: var(--navy-mid);
  padding: 16px 30px;
  border-top: 2px solid var(--gold);
  margin-top: 20px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-left { font-size: 10px; color: rgba(255, 255, 255, 0.45); letter-spacing: 1px; text-transform: uppercase; }
.footer-right { font-size: 10px; color: var(--gold); letter-spacing: 1px; text-transform: uppercase; font-weight: 700; }

@media (max-width: 700px) {
  .header { flex-direction: column; align-items: center; }
  .logo-wrap { padding: 16px 20px 4px 20px; }
  .hero { padding: 16px; width: 100%; }
  .wrapper { padding: 16px 14px; }
  .dedication-banner { flex-direction: column; text-align: center; }
  .footer-content { flex-direction: column; align-items: center; text-align: center; }
}
