/* ============================================================
   Nalepke na Izletu — Župnija Dravlje theme
   Matching zupnija-dravlje.si design tokens
   ============================================================ */

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

:root {
  /* ── Parish palette ── */
  --primary:    #213D5D;
  --primary-d:  #192e47;
  --accent:     #DE8739;
  --accent-d:   #c0721e;
  --bg:         #EEEFEA;
  --surface:    #fff;
  --border:     #EFDBBF;
  --border2:    #d8c9a8;
  --text:       #424242;
  --heading:    #212121;
  --muted:      #97A8B2;
  --faded:      #b8c5cc;
  --link:       #213D5D;

  /* ── Frame colours ── */
  --frame-outer: #213D5D;
  --frame-mid:   #fff;
  --frame-inner: #EFDBBF;

  /* ── Misc ── */
  --radius:    0.3rem;
  --radius-lg: 0.6rem;
  --shadow:    0 5px 15px rgba(0,0,0,.12);
  --shadow-sm: 0 2px 6px rgba(0,0,0,.08);
}

body {
  font-family: 'Nunito', sans-serif;
  font-weight: 300;
  letter-spacing: 0.03em;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ─── HERO / INTRO BANNER ────────────────────────────────── */
.hero-banner {
  background: var(--primary);
  color: #fff;
  padding: 2.25rem 1rem 2rem;
  text-align: center;
  border-bottom: 4px solid var(--accent);
}

.hero-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  padding: 6px;
  margin-bottom: .9rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}

.hero-parish {
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .3rem;
}

.hero-title {
  font-family: 'Nunito', sans-serif;
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #fff;
  line-height: 1.2;
  margin-bottom: .6rem;
}

.hero-subtitle {
  font-size: .88rem;
  font-weight: 300;
  color: rgba(255,255,255,.82);
  max-width: 560px;
  margin: 0 auto .95rem;
  line-height: 1.6;
}

.hero-subtitle strong { color: #fff; font-weight: 700; }

.hero-meta {
  display: flex;
  justify-content: center;
  gap: 1.1rem;
  flex-wrap: wrap;
}

.hero-meta-item {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .78rem;
  font-weight: 700;
  color: rgba(255,255,255,.75);
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  padding: .25rem .7rem;
}

/* ─── HEADER (sticky) ────────────────────────────────────── */
.site-header {
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem 1rem .55rem;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
}

.header-title {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.header-logo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  padding: 2px;
}

.header-title h1 {
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.03em;
}

.header-count {
  display: flex;
  align-items: baseline;
  gap: .2rem;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  padding: .28rem .85rem;
  white-space: nowrap;
}

.count-num   { font-size: 1.25rem; font-weight: 900; color: var(--accent); }
.count-sep   { font-size: .9rem; color: rgba(255,255,255,.45); }
.count-total { font-size: .9rem; color: rgba(255,255,255,.7); font-weight: 700; }
.count-label { font-size: .68rem; color: rgba(255,255,255,.55); margin-left: .1rem; }
.count-bonus {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: .08rem .45rem;
  font-size: .7rem;
  font-weight: 900;
  margin-left: .3rem;
}

.progress-bar-wrap {
  height: 4px;
  background: rgba(255,255,255,.15);
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  transition: width .7s cubic-bezier(.34,1.56,.64,1);
}

/* ─── CONTAINER ──────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.75rem 1rem 5rem;
}

.section-title {
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

/* ─── STICKER GRID ───────────────────────────────────────── */
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 1rem;
}

/* ─── STICKER CARDS ──────────────────────────────────────── */
.sticker-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.sticker-card:hover:not(.locked) {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(33,61,93,.18);
  border-color: var(--accent);
}

/* Uploaded card */
.sticker-card.uploaded {
  border-color: var(--accent);
  box-shadow: 0 3px 12px rgba(222,135,57,.2);
}

/* Empty card */
.sticker-card.empty {
  border-style: dashed;
  border-color: var(--border2);
}

/* Locked card */
.sticker-card.locked {
  background: #f5f5f2;
  border-color: #ddd;
  cursor: default;
  opacity: .6;
}

/* Bonus card */
.sticker-card.bonus-card {
  border-color: var(--accent) !important;
  box-shadow: 0 0 14px rgba(222,135,57,.25);
}

/* ── Upload button (top of empty card) ── */
.card-upload-area {
  padding: .9rem .75rem .5rem;
  flex-shrink: 0;
}

.card-upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  width: 100%;
  padding: .6rem .5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: .82rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  cursor: pointer;
  transition: background .15s, transform .12s;
  letter-spacing: .02em;
  box-shadow: 0 2px 6px rgba(222,135,57,.35);
}

.card-upload-btn:hover {
  background: var(--accent-d);
  transform: translateY(-1px);
}

/* ── Empty sticker slot placeholder ── */
.card-sticker-slot {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #f5f0e8;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-top: 3px solid var(--border2);
  border-bottom: 3px solid var(--border2);
  box-shadow: inset 0 3px 10px rgba(33,61,93,.07);
  flex-shrink: 0;
  overflow: hidden;
}

.card-sticker-slot.slot-landscape { aspect-ratio: 4 / 3; }

.card-sticker-slot::before {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1.5px dashed rgba(33,61,93,.2);
  border-radius: 2px;
  pointer-events: none;
}

.card-slot-num {
  font-family: 'Nunito', sans-serif;
  font-size: 3.8rem;
  font-weight: 900;
  color: rgba(33,61,93,.11);
  line-height: 1;
  user-select: none;
  letter-spacing: -0.03em;
}

/* ── Photo FRAME (the key visual element) ── */
.card-img-wrap {
  width: 100%;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;

  /* Frame effect: outer navy border → white mat → inner beige */
  border-top:    4px solid var(--primary);
  border-bottom: 4px solid var(--primary);
  outline: 3px solid #fff;
  outline-offset: -7px;
}

.card-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform .3s ease;
}

.sticker-card:hover .card-img-wrap img { transform: scale(1.04); }

/* Hover timestamp overlay */
.card-overlay {
  position: absolute;
  inset: auto 0 0;
  background: linear-gradient(transparent, rgba(33,61,93,.7));
  padding: .4rem .45rem .3rem;
  opacity: 0;
  transition: opacity .2s;
}
.sticker-card:hover .card-overlay { opacity: 1; }
.card-time { font-size: .63rem; color: rgba(255,255,255,.8); display: block; }

/* ── Uploader name (under photo) ── */
.card-uploader-name {
  padding: .3rem .65rem .05rem;
  font-size: .74rem;
  font-weight: 900;
  color: var(--accent-d);
  letter-spacing: .02em;
  flex-shrink: 0;
}

/* ── Description (always at bottom) ── */
.card-desc {
  padding: .4rem .65rem .65rem;
  font-size: .76rem;
  color: var(--text);
  line-height: 1.4;
  font-weight: 600;
  flex: 1;
}

/* ── Locked card body ── */
.card-lock-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  background: rgba(245,240,232,.72);
}

.card-lock-msg {
  padding: .45rem .65rem .65rem;
  font-size: .72rem;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
  line-height: 1.35;
}

/* ── Bonus section ── */
.bonus-section {
  margin-bottom: 1.75rem;
  background: #fffbf5;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1rem 1rem;
}

/* ─── POP-IN ANIMATION ───────────────────────────────────── */
@keyframes cardPop {
  0%   { transform: scale(.5) rotate(-4deg); opacity: 0; }
  55%  { transform: scale(1.1) rotate(1deg); }
  75%  { transform: scale(.97); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.card-pop { animation: cardPop .5s cubic-bezier(.34,1.56,.64,1) forwards; }

/* ─── CONFETTI ───────────────────────────────────────────── */
.confetti-dot {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  animation: confettiFly .65s ease-out forwards;
}
@keyframes confettiFly {
  0%   { transform: translate(0,0) rotate(0deg);   opacity: 1; }
  100% { transform: translate(var(--tx),var(--ty)) rotate(540deg); opacity: 0; }
}

/* ─── MILESTONE OVERLAY ──────────────────────────────────── */
.milestone-overlay {
  position: fixed;
  inset: 0;
  background: rgba(33,61,93,.82);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.milestone-box {
  background: #fff;
  border: 3px solid var(--border);
  border-top: 5px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
  position: relative;
  overflow: hidden;
  animation: mBoxIn .38s cubic-bezier(.34,1.56,.64,1);
}

@keyframes mBoxIn {
  0%   { transform: scale(.75) translateY(20px); opacity: 0; }
  100% { transform: scale(1)   translateY(0);    opacity: 1; }
}

.milestone-fireworks { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.fw-particle {
  position: absolute;
  border-radius: 50%;
  animation: fwPop .9s ease-out forwards;
}
@keyframes fwPop {
  0%   { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx),var(--ty)) scale(0); opacity: 0; }
}

.milestone-emoji { font-size: 3rem; display: block; animation: mEmojiSpin .55s ease-out; }
@keyframes mEmojiSpin {
  0%   { transform: rotate(-20deg) scale(.6); }
  60%  { transform: rotate(10deg)  scale(1.15); }
  100% { transform: rotate(0)      scale(1); }
}

.milestone-box h2 {
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--primary);
  margin: .45rem 0 .3rem;
  letter-spacing: .04em;
}
.milestone-box p { color: var(--muted); font-size: .9rem; margin-bottom: .9rem; }

.bonus-reveal {
  background: #fffbf5;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: .8rem;
  margin: .6rem 0;
}
.bonus-card-mini { text-align: center; }
.bonus-star { font-size: 1.3rem; }
.bonus-card-mini strong { display: block; font-size: .85rem; color: var(--accent-d); margin: .25rem 0 .15rem; font-weight: 900; }
.bonus-card-mini p { font-size: .78rem; color: var(--text); }

.btn-close-overlay {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: .65rem 2rem;
  font-size: .95rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  cursor: pointer;
  transition: background .15s;
  box-shadow: 0 2px 8px rgba(222,135,57,.4);
}
.btn-close-overlay:hover { background: var(--accent-d); }

/* ─── UPLOAD MODAL ───────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(33,61,93,.65);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 600px) {
  .modal-backdrop { align-items: center; padding: 1rem; }
}

.modal-box {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-top: 4px solid var(--accent);
  padding: 1.4rem 1.2rem 2rem;
  width: 100%;
  max-width: 460px;
  max-height: 93vh;
  overflow-y: auto;
  position: relative;
  animation: modalSlideUp .28s ease-out;
}

@media (min-width: 600px) {
  .modal-box { border-radius: var(--radius-lg); }
}

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

.modal-close {
  position: absolute;
  top: .8rem;
  right: .8rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 1.9rem;
  height: 1.9rem;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: background .15s;
}
.modal-close:hover { background: var(--border); }

.modal-sticker-num {
  font-size: .82rem;
  font-weight: 900;
  color: var(--accent-d);
  margin-bottom: .3rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.modal-instruction {
  font-size: 1rem;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 1.2rem;
  line-height: 1.4;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
}

.btn-camera, .btn-gallery {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  padding: 1rem .65rem;
  border-radius: var(--radius);
  font-size: .85rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  cursor: pointer;
  transition: background .15s, transform .12s;
  min-height: 76px;
  border: 2px solid transparent;
}
.btn-camera input, .btn-gallery input { display: none; }

.btn-camera  {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(222,135,57,.3);
}
.btn-camera:hover  { background: var(--accent-d); transform: translateY(-2px); }

.btn-gallery {
  background: var(--surface);
  color: var(--primary);
  border-color: var(--border2);
}
.btn-gallery:hover { background: var(--bg); transform: translateY(-2px); }

/* Crop step */
.crop-toolbar { display: flex; gap: .5rem; margin-bottom: .55rem; }

.btn-rotate {
  flex: 1;
  padding: .42rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .82rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  color: var(--primary);
  transition: background .15s;
}
.btn-rotate:hover { background: var(--border); }

.cropper-container-wrap {
  max-height: 280px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #000;
  border: 2px solid var(--border);
}
.cropper-container-wrap img { max-height: 280px; display: block; }

.crop-footer { margin-top: .8rem; }

.upload-name-label {
  display: block;
  font-size: .82rem;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: .7rem;
}

.upload-name-label input {
  display: block;
  width: 100%;
  margin-top: .22rem;
  padding: .52rem .7rem;
  background: var(--bg);
  border: 2px solid var(--border2);
  border-radius: var(--radius);
  font-size: .9rem;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}
.upload-name-label input:focus { border-color: var(--primary); }

.crop-buttons { display: flex; gap: .55rem; margin-top: .45rem; }

.btn-secondary {
  flex: 1;
  padding: .65rem;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  font-size: .85rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
}
.btn-secondary:hover { background: var(--border); }

.btn-submit {
  flex: 2;
  padding: .65rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: .9rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  cursor: pointer;
  transition: background .15s;
  box-shadow: 0 2px 8px rgba(222,135,57,.35);
}
.btn-submit:hover:not(:disabled) { background: var(--accent-d); }
.btn-submit:disabled { opacity: .5; cursor: default; }

/* Uploading / success */
.uploading-spinner {
  font-size: 2.8rem;
  text-align: center;
  animation: spin 1s linear infinite;
  margin: 1.5rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

#step-uploading, #step-success { text-align: center; padding: 1.5rem 0; }

.success-icon { font-size: 3rem; animation: mEmojiSpin .5s ease-out; margin-bottom: .45rem; }
#step-success h3 { font-size: 1.3rem; font-weight: 400; color: var(--primary); margin-bottom: .3rem; letter-spacing: .04em; }
#step-success p  { color: var(--muted); font-size: .88rem; margin-bottom: .9rem; }
#step-success .btn-submit { flex: none; padding: .65rem 2rem; }

/* ─── FULLSCREEN VIEWER ──────────────────────────────────── */
.fullscreen-overlay {
  position: fixed;
  inset: 0;
  background: rgba(33,61,93,.93);
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.fullscreen-inner { position: relative; max-width: 560px; width: 100%; }

.fullscreen-inner img {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: var(--radius);
  display: block;
  border: 4px solid #fff;
  box-shadow: 0 0 0 3px var(--accent);
}

.fullscreen-info {
  color: rgba(255,255,255,.75);
  padding: .6rem;
  font-size: .85rem;
  line-height: 1.5;
}
.fullscreen-info strong { color: #fff; font-weight: 900; }

.fullscreen-close {
  position: absolute;
  top: -.45rem;
  right: -.45rem;
  background: var(--accent);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 2.1rem;
  height: 2.1rem;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  box-shadow: var(--shadow-sm);
  transition: background .15s;
}
.fullscreen-close:hover { background: var(--accent-d); }

/* ─── SOUND BUTTON ───────────────────────────────────────── */
.sound-btn {
  position: fixed;
  bottom: 1.2rem;
  right: 1.2rem;
  background: var(--primary);
  border: 2px solid rgba(255,255,255,.2);
  border-radius: 50%;
  width: 2.8rem;
  height: 2.8rem;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 200;
  transition: background .15s;
  color: #fff;
}
.sound-btn:hover { background: var(--primary-d); }

/* ─── ADMIN (inline overrides) ───────────────────────────── */
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 400px) {
  .sticker-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .header-title h1 { font-size: .85rem; }
}
@media (min-width: 768px) {
  .sticker-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}

/* Cropper overrides */
.cropper-view-box, .cropper-face { border-radius: 2px; }
