:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --ink: #2b2620;
  --muted: #8a8177;
  --accent: #a85d6d;
  --accent-dark: #8c4356;
  --error-bg: #fdecec;
  --error-ink: #a33030;
  --track: #ece5dc;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, 'Times New Roman', serif;
}

/* venčana pozadina — floralna ramka (pozadina.jpg) */
body {
  background-color: #ffffff;
  background-image: url('../img/pozadina.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  isolation: isolate; /* grane (z-index:0) ostaju iza sadržaja, iznad pozadine */
}

/* dekorativne grane u uglovima — sakrivene: pozadina.jpg već ima cvetnu ramku */
.floral {
  display: none;
}

@media (max-width: 640px) {
  .floral { opacity: 0.32; }
}

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--card);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-size: 20px;
  font-style: italic;
  letter-spacing: 0.5px;
}

.nav-link {
  color: #8E6531;
  text-decoration: none;
  font-size: 16px;
  padding: 8px 14px;
  border-radius: 999px;
}
.nav-link:hover { background: rgba(168, 137, 97, 0.12); }

.nav-spacer { width: 74px; } /* balansira brand centar */

/* ---------- layout ---------- */
.home-main, .gallery-main {
  position: relative;
  z-index: 1; /* sadržaj iznad dekorativnih grana */
  min-height: calc(100vh - 60px);
  display: grid;
  place-items: center;
  padding: 24px 16px 48px;
}

.card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(43, 38, 32, 0.08);
  padding: 32px;
  width: min(92vw, 560px);
  text-align: center;
}

.hidden { display: none !important; }

/* ---------- select ---------- */
.select-card .hint { color: var(--muted); margin-top: 0; font-size: 17px; }

/* venčanje — imena i datum iznad naslova */
.hero { text-align: center; margin-bottom: 26px; }
.hero-names {
  margin: 0;
  font-family: 'Great Vibes', 'Segoe Script', cursive;
  font-size: clamp(3rem, 8vw, 4.6rem);
  line-height: 1.05;
  color: #A88961;
}
.hero-date {
  margin: 8px 0 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.05rem, 3vw, 1.35rem);
  letter-spacing: 0.2em;
  color: #8E6531;
}
.hero-divider {
  display: block;
  width: 74px;
  height: 2px;
  margin: 18px auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #A88961, transparent);
}

.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

/* Zlatna dugmenda (GOLD #A88961 / #8E6531): „Otpremi" i „Izaberi slike/video" */
#btn-upload,
#btn-select {
  background: #A88961;
  color: #2b2620;
}
#btn-upload:hover:not(:disabled),
#btn-select:hover:not(:disabled) { background: #8E6531; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }

.btn-secondary {
  background: var(--track);
  color: var(--ink);
}

.btn-big {
  font-size: 19px;
  padding: 14px 32px;
  border-radius: 999px;
}

/* ---------- upload / progress ---------- */
.file-summary {
  color: var(--muted);
  margin-bottom: 16px;
  font-size: 15px;
}

.progress-wrap {
  position: relative;
  background: var(--track);
  border-radius: 999px;
  height: 22px;
  overflow: hidden;
  margin-bottom: 8px;
}

#progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--ink);
  font-family: Verdana, sans-serif;
}

.eta-text {
  min-height: 20px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 16px;
  font-family: Verdana, sans-serif;
}

/* ---------- errors ---------- */
.error-card { border: 1px solid #f3c9c9; background: var(--error-bg); }
.error-title { color: var(--error-ink); font-size: 17px; margin-bottom: 8px; }
#error-list {
  text-align: left;
  color: var(--error-ink);
  margin: 0 0 16px;
  padding-left: 20px;
  font-size: 14px;
  max-height: 200px;
  overflow-y: auto;
}

/* ---------- done ---------- */
.done-msg {
  font-size: 22px;
  margin-bottom: 20px;
  color: var(--ink);
}

/* ---------- gallery (placeholder faza) ---------- */
.empty-msg { color: var(--muted); font-size: 17px; }

.gallery-main { align-items: start; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  width: min(96vw, 900px);
}

.gallery-grid img,
.gallery-grid video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  background: #eee;
  cursor: pointer;
}

/* ---------- lightbox / pregled ---------- */
body.lb-open { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 16, 13, 0.9);
}

.lb-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 56px 72px;
}

.lb-media {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  background: #000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lb-btn {
  position: absolute;
  z-index: 2;
  border: none;
  cursor: pointer;
  font-family: Verdana, sans-serif;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  transition: background 0.15s ease;
}
.lb-btn:hover { background: rgba(0, 0, 0, 0.6); }

.lb-close {
  top: 12px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 30px;
  line-height: 1;
}

.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 34px;
  line-height: 1;
}
.lb-prev { left: 16px; }
.lb-next { right: 16px; }

.lb-counter {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 14px;
  letter-spacing: 0.5px;
  font-family: Verdana, sans-serif;
}

@media (max-width: 640px) {
  .lb-stage { padding: 56px 8px; }
  .lb-nav { width: 42px; height: 42px; font-size: 26px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}
