/* ============================================================
   JU MŠŠ MAGLAJ — style.css
   ============================================================ */


/* ===== RESET & BASE ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== MOBILE FIX: slike u galeriji moraju biti tappable na svim mobilnim browserima ===== */
.album-images img,
.post-images img,
.kuca-slavnih-img,
img[onclick] {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}


/* ===== CSS VARIJABLE (SVIJETLI MOD) ===== */
:root {
  --primary-color: #005baa;
  --primary-light: #e8f0fe;
  --primary-dark: #003d73;
  --text-color: #1a1a2e;
  --text-muted: #6c757d;
  --card-bg: #ffffff;
  --card-bg-alt: #f8f9fa;
  --border-color: #e0e0e0;
  --hover-bg: #f1f5f9;
  --warning-light: #fff3e0;
  --warning-dark: #e67e22;
  --input-bg: #ffffff;
}

body {
  font-family: 'Libre Baskerville', serif;
  background: #f4f4f4;
  color: var(--text-color);
  transition: background 0.3s ease, color 0.3s ease;
}


/* ===== TAMNI MOD (preko data-theme atributa) ===== */
[data-theme="dark"] {
  --primary-color: #3b82f6;
  --primary-light: #1e293b;
  --primary-dark: #60a5fa;
  --text-color: #e2e8f0;
  --text-muted: #94a3b8;
  --card-bg: #1e293b;
  --card-bg-alt: #0f172a;
  --border-color: #334155;
  --hover-bg: #334155;
  --warning-light: #422800;
  --warning-dark: #f59e0b;
  --input-bg: #0f172a;
}

[data-theme="dark"] body { background: #121212; }
[data-theme="dark"] main { background: #1e1e1e; }

[data-theme="dark"] .quiz-modal,
[data-theme="dark"] #cal-box,
[data-theme="dark"] #res-box,
[data-theme="dark"] #dz-box {
  background: #1e1e1e;
  color: #e4e4e4;
}

[data-theme="dark"] .rasp-item,
[data-theme="dark"] .kalk-row,
[data-theme="dark"] .res-card {
  background: #2a2a2a;
  border-color: #3a3a3a;
}

[data-theme="dark"] .rasp-picker select,
[data-theme="dark"] .kalk-row select {
  background: #2a2a2a;
  color: #e4e4e4;
  border-color: #3a3a3a;
}

[data-theme="dark"] .rasp-item.past {
  background: #1a1a1a;
  opacity: 0.6;
}

[data-theme="dark"] .rasp-day-header {
  background: #0f172a;
  color: #60a5fa;
}

[data-theme="dark"] .rasp-meta {
  background: #2a2a2a;
  border-color: #3a3a3a;
}


/* ===== HEADER & NAVIGACIJA ===== */
header { overflow: hidden; }

.header-gallery {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  height: 240px;
  width: 100%;
  position: relative;
  z-index: 1;
}
.header-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(70%);
}

.header-bar {
  background: #005baa;
  color: #fff;
  text-align: center;
  padding: 30px 10px 20px;
  position: relative;
  z-index: 10;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.school-name {
  margin: 0;
  font-size: 28px;
  font-weight: bold;
}

.main-nav {
  margin-top: 15px;
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.main-nav a,
.main-nav button {
  color: #ffffff !important;
  text-decoration: none;
  font-weight: bold;
  padding: 8px 15px;
  font-size: 16px;
  border-radius: 5px;
  background-color: #0071ce !important;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-family: 'Libre Baskerville', serif;
}
.main-nav a:hover,
.main-nav button:hover {
  background-color: #003f7f !important;
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 91, 170, 0.25);
}


/* ===== MAIN & SEKCIJE ===== */
main {
  padding: 20px;
  max-width: 1000px;
  margin: auto;
  background: #fff;
  transition: background 0.3s ease;
}

section { margin-bottom: 40px; }

section h2 {
  font-size: 26px;
  color: #003f7f;
  border-bottom: 3px solid #005baa;
  padding-bottom: 8px;
  margin-bottom: 20px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  position: relative;
  width: auto;
}
section h2 i { color: #005baa; }
section h2.in-view {
  opacity: 1;
  transform: translateX(0);
}
section h2.in-view::after { width: 100%; }
section h2.in-view i { animation: iconBounce 0.6s ease-out 0.4s; }

@keyframes iconBounce {
  0%   { transform: scale(1) rotate(0deg); }
  50%  { transform: scale(1.3) rotate(-10deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 15px 0;
  color: #005baa;
  font-size: 18px;
  border-bottom: 1px solid #ccc;
  padding-bottom: 5px;
  justify-content: space-between;
}


/* ===== DUGMAD U POSTU (HIDE & SHARE) ===== */
.hide-post-btn {
  display: none;
  padding: 6px 18px;
  background: #f44336;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.3s ease;
  margin-left: 16px;
}
.hide-post-btn:hover {
  background: #c62828 !important;
  transform: scale(1.05);
}

.share-single-btn {
  position: relative;
  background-color: #0071ce;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 5px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.share-single-btn:hover {
  background-color: #005baa;
  transform: rotate(15deg) scale(1.15);
}
.share-single-btn[data-tooltip]::after,
.share-single-btn[data-tooltip]::before {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
.share-single-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  bottom: calc(100% + 6px);
  right: 0;
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  transform: translateY(4px);
  z-index: 1000;
}
.share-single-btn[data-tooltip]::before {
  content: "";
  border: 6px solid transparent;
  border-top-color: rgba(0,0,0,0.85);
  bottom: 100%;
  right: 12px;
  transform: translateY(4px);
}
.share-single-btn[data-tooltip]:hover::after,
.share-single-btn[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateY(0);
}


/* ===== DUGME "POGLEDAJ FOTOGRAFIJE U GALERIJI" (U OBJAVAMA) ===== */
.goto-gallery-wrap {
  margin-top: 20px;
  padding-top: 16px;
  text-align: center;
}
.goto-gallery-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background-color: #0071ce;
  color: #fff !important;
  text-decoration: none;
  font-family: 'Libre Baskerville', serif;
  font-weight: bold;
  font-size: 16px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 91, 170, 0.2);
  transition: all 0.3s ease;
}
.goto-gallery-btn:hover {
  background: linear-gradient(135deg, #005baa, #007acc);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 91, 170, 0.25);
  letter-spacing: 1px;
}
.goto-gallery-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 91, 170, 0.2);
}
.goto-gallery-btn i { font-size: 16px; }

[data-theme="dark"] .goto-gallery-btn {
  background-color: #3b82f6;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}
[data-theme="dark"] .goto-gallery-btn:hover {
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}


/* ===== ALBUM & POSTOVI ===== */
.album-images {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin-bottom: 20px;
}
.album-images img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  cursor: pointer;
  transition: transform .3s ease;
}

.posts .post {
  display: none;
  margin-bottom: 25px;
}
.posts .post:nth-child(-n+2) { display: block; }

/* Sve slike unutar objava — automatski responsivne */
.posts .post img,
article.post img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  margin-top: 10px;
}

.load-more {
  display: none;
  margin: 20px auto;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  background-color: #0071ce;
  color: #fff;
  border: none;
  border-radius: 5px;
  transition: all 0.3s ease;
}
.load-more:hover {
  background: linear-gradient(135deg, #005baa, #007acc);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 91, 170, 0.25);
  letter-spacing: 1px;
}


/* ===== FOOTER ===== */
footer {
  background: #333;
  color: #fff;
  text-align: center;
  padding: 15px 0;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.social-icons {
  display: flex;
  gap: 16px;
}
.social-icons a {
  color: #005baa;
  font-size: 20px;
  padding: 10px;
  border-radius: 50%;
  transition: color 0.3s ease, transform 0.3s ease;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.social-icons a:hover { transform: translateY(-3px); }
.social-icons a[aria-label="Facebook"]:hover { color: #1877F2; }
.social-icons a[aria-label="Instagram"]:hover {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.social-icons a[aria-label*="Lokacija"]:hover { color: #EA4335; }


/* ===== BROJAČ POSJETA ===== */
.visit-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  font-size: 13px;
  color: #ddd;
  font-family: sans-serif;
  margin-top: 4px;
}
.visit-counter i {
  color: #5fb3ff;
  font-size: 14px;
}
.visit-counter .vc-num {
  font-weight: 700;
  color: #fff;
  min-width: 24px;
  text-align: center;
  letter-spacing: 0.5px;
}
.visit-counter .vc-num.loading { opacity: 0.5; }


/* ===== METADATA (RAZRED I RAZREDNIK) ===== */
.rasp-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  padding: 8px 14px;
  border-radius: 40px;
  font-size: 0.9rem;
  color: var(--text-color);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}
.rasp-meta i {
  font-size: 1rem;
  color: var(--primary-color);
}

#rasp-meta-smjer,
#rasp-meta-razrednik { transition: all 0.2s ease; }


/* ===== RASPORED ZA SVAKI DAN ===== */
.rasp-day {
  background: var(--card-bg);
  border-radius: 16px;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}
.rasp-day-header {
  background: var(--primary-light);
  padding: 12px 16px;
  font-weight: bold;
  font-size: 1rem;
  color: var(--primary-dark);
  border-bottom: 2px solid var(--primary-color);
}

.rasp-subject {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.2s;
}
.rasp-subject:last-child { border-bottom: none; }
.rasp-subject:hover { background: var(--hover-bg); }

.rasp-time {
  min-width: 70px;
  font-weight: 600;
  color: var(--primary-color);
  font-size: 0.85rem;
}
.rasp-name {
  flex: 1;
  font-weight: 500;
}
.rasp-teacher {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.no-rasp {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
}

.rasp-picker {
  background: var(--card-bg-alt);
  padding: 16px;
  border-radius: 20px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.rasp-picker label { font-weight: 600; }

#rasp-razred {
  padding: 8px 12px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-color);
  font-size: 0.9rem;
}

.rasp-day-info {
  background: var(--warning-light);
  padding: 6px 12px;
  border-radius: 30px;
  font-size: 0.8rem;
  color: var(--warning-dark);
  margin-left: auto;
}


/* ===== ĐAČKA ZONA MODAL ===== */
#dz-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  z-index: 11000;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 10px;
  overflow-y: auto;
}
#dz-overlay.open { display: flex; }

#dz-box {
  background: #fff;
  border-radius: 20px;
  padding: 0;
  width: 100%;
  max-width: 820px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.3);
  overflow: hidden;
  margin: auto;
  display: flex;
  flex-direction: column;
}

#dz-header {
  background: linear-gradient(135deg, #003f7f, #005baa);
  color: #fff;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
#dz-header h2 {
  font-size: 22px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
#dz-header p {
  font-size: 13px;
  opacity: 0.75;
  margin-top: 4px;
}

#dz-close-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#dz-close-btn:hover { background: rgba(255,255,255,0.3); }

#dz-tabs {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  background: #f8f9fa;
  flex-shrink: 0;
}
.dz-tab {
  flex: 1;
  padding: 14px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: bold;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-bottom: 3px solid transparent;
}
.dz-tab:hover { color: #005baa; }
.dz-tab.active {
  color: #005baa;
  border-bottom-color: #005baa;
  background: #fff;
}

#dz-body {
  padding: 24px 28px;
  overflow-y: auto;
  max-height: 70vh;
}

.dz-screen { display: none; }
.dz-screen.active { display: block; }


/* ===== RASPORED WIDGET ===== */
.rasp-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.rasp-picker label { font-size: 14px; color: #555; }
.rasp-picker select {
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-family: inherit;
  cursor: pointer;
}

.rasp-day-info {
  font-size: 14px;
  color: #003f7f;
  font-weight: bold;
  margin-left: auto;
}

.rasp-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rasp-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: #fafcff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  transition: all 0.2s;
  flex-wrap: wrap;
}
.rasp-item.past {
  opacity: 0.5;
  background: #f1f5f9;
}
.rasp-item.now {
  background: linear-gradient(135deg, #005baa, #003f7f);
  color: #fff;
  border-color: #003f7f;
  box-shadow: 0 4px 14px rgba(0,91,170,0.3);
}
.rasp-item.now .rasp-time { color: #cce4ff; }

.rasp-time {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: #64748b;
  min-width: 95px;
  font-weight: bold;
}
.rasp-subject {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  min-width: 140px;
}
.rasp-now-badge {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.25);
  font-weight: bold;
  letter-spacing: 0.5px;
}
.rasp-progress {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.rasp-progress-bar {
  height: 100%;
  background: #fff;
  transition: width 1s linear;
}
.rasp-empty {
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
  font-size: 14px;
}
.rasp-empty i {
  font-size: 48px;
  color: #cbd5e1;
  margin-bottom: 12px;
  display: block;
}


/* ===== ODMORI IZMEĐU ČASOVA ===== */
.rasp-break {
  background: rgba(255, 193, 7, 0.15);
  border-left: 4px solid #ffc107;
  border-radius: 8px;
  padding: 8px 12px;
  margin: 8px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #b8860b;
}
.rasp-break.break-now {
  background: rgba(255, 193, 7, 0.3);
  border-left-color: #ff9800;
  animation: pulse-break 1.5s infinite;
}
.rasp-break-icon i { font-size: 14px; }
.rasp-break-name {
  font-weight: 600;
  text-transform: lowercase;
}
.rasp-break-name::first-letter { text-transform: uppercase; }
.rasp-break-time {
  font-family: monospace;
  font-size: 12px;
  opacity: 0.75;
}
.rasp-break-badge {
  background: #ffc107;
  color: #333;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: bold;
  margin-left: auto;
}
@keyframes pulse-break {
  0%, 100% { opacity: 0.7; }
  50%      { opacity: 1; background: rgba(255, 193, 7, 0.45); }
}


/* ===== KALKULATOR PROSJEKA ===== */
.kalk-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.kalk-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #fafcff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.kalk-row select {
  padding: 6px 10px;
  font-size: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-family: inherit;
  background: #fff;
}
.kalk-row select:first-of-type { flex: 1; }
.kalk-row .kalk-del {
  background: #fee2e2;
  color: #b91c1c;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.kalk-row .kalk-del:hover { background: #fecaca; }

.kalk-add {
  background: #f0f7ff;
  border: 1px dashed #b3d4f5;
  color: #0071ce;
  padding: 12px;
  width: 100%;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  font-weight: bold;
  transition: background 0.2s;
}
.kalk-add:hover { background: #e0eefb; }

.kalk-result {
  background: linear-gradient(135deg, #005baa, #003f7f);
  color: #fff;
  padding: 20px 24px;
  border-radius: 14px;
  text-align: center;
  margin: 20px 0;
}
.kalk-result-num {
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
}
.kalk-result-label {
  font-size: 13px;
  opacity: 0.9;
  margin-top: 6px;
}
.kalk-result-grade {
  font-size: 14px;
  margin-top: 8px;
  font-weight: bold;
}

.kalk-whatif {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 12px;
  padding: 16px;
}
.kalk-whatif h4 {
  margin-bottom: 10px;
  color: #f57f17;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.kalk-whatif p {
  font-size: 13px;
  color: #555;
  line-height: 1.7;
  margin-bottom: 4px;
}
.kalk-whatif strong { color: #003f7f; }


/* ===== SLJEDEĆE ZVONO ===== */
.next-bell {
  background: #0a0a0a;
  padding: 10px 16px;
  text-align: center;
  border-top: 1px solid #2a2a2a;
  font-family: sans-serif;
  color: #ccc;
  font-size: 13px;
  display: none;
}
.next-bell.active { display: block; }
.next-bell strong {
  color: #5fb3ff;
  font-weight: 700;
  font-size: 14px;
}
.next-bell .nb-time {
  font-family: 'Courier New', monospace;
  color: #fff;
  font-weight: bold;
  letter-spacing: 1px;
  margin: 0 4px;
}
.next-bell .nb-extra { color: #888; }


/* ===== DARK MODE TOGGLE ===== */
.header-bar { position: relative; }
.theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.18);
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.3s;
  z-index: 20;
}
.theme-toggle:hover {
  background: rgba(255,255,255,0.32);
  transform: rotate(20deg);
}


/* ===== KUĆA SLAVNIH — GALERIJA ===== */
.kuca-slavnih-galerija {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0 10px 0;
}
.kuca-slavnih-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.kuca-slavnih-img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}


/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-top: 18px;
  padding: 12px;
  background: #0071ce;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-family: 'Libre Baskerville', serif;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  width: 45px;
  height: 45px;
}
.back-to-top:hover {
  background: #003f7f;
  transform: translateY(-2px);
}
.back-to-top i {
  font-size: 20px;
  margin: 0;
}


/* ===== GALERIJA & LIGHTBOX ===== */
#galerija .load-more {
  display: block;
  margin-bottom: 40px;
}

#lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.88);
  justify-content: center;
  align-items: center;
  z-index: 999;
}
#lightbox #lightbox-img {
  max-width: 88%;
  max-height: 88%;
  border-radius: 10px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
  user-select: none;
  cursor: default;
}

/* Okrugli, polu-transparentni dugmići za navigaciju lightboxa */
#lightbox .lb-close,
#lightbox .lb-prev,
#lightbox .lb-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: #fff;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, transform 0.25s ease, opacity 0.2s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  line-height: 1;
  padding: 0;
}
#lightbox .lb-close:hover,
#lightbox .lb-prev:hover,
#lightbox .lb-next:hover {
  background: rgba(255, 255, 255, 0.35);
}

#lightbox .lb-prev {
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
}
#lightbox .lb-next {
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
}
#lightbox .lb-prev:hover { transform: translateY(-50%) scale(1.12); }
#lightbox .lb-next:hover { transform: translateY(-50%) scale(1.12); }

#lightbox .lb-close {
  top: 22px;
  right: 22px;
  width: 44px;
  height: 44px;
  font-size: 26px;
}
#lightbox .lb-close:hover { transform: scale(1.12); }

/* Counter na dnu (npr. "3 / 8") */
#lightbox .lb-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 13px;
  font-family: sans-serif;
  font-weight: 600;
  letter-spacing: 0.5px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}

/* Mobitel — manji dugmići, bliže rubu */
@media (max-width: 600px) {
  #lightbox .lb-close,
  #lightbox .lb-prev,
  #lightbox .lb-next {
    width: 42px;
    height: 42px;
    font-size: 18px;
  }
  #lightbox .lb-close {
    width: 38px;
    height: 38px;
    top: 12px;
    right: 12px;
    font-size: 22px;
  }
  #lightbox .lb-prev { left: 10px; }
  #lightbox .lb-next { right: 10px; }
  #lightbox .lb-counter {
    bottom: 14px;
    font-size: 12px;
    padding: 5px 12px;
  }
}


/* ===== SLIKE U POSTU ===== */
.post-images {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-bottom: 15px;
}
.post-images .post-img {
  width: 50%;
  height: auto;
  object-fit: cover;
  border-radius: 6px;
}


/* ===== COUNTDOWN ===== */
.cd-bar {
  background: #111;
  padding: 1.1rem 1rem;
  text-align: center;
  font-family: 'Courier New', monospace;
}
.cd-bar-label-top {
  font-size: 15px;
  color: #ccc;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: .9rem;
  font-family: sans-serif;
  font-weight: bold;
}
.cd-bar-units {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 0;
  flex-wrap: nowrap;
}
.cd-bar-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}
.cd-bar-sep {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 5px;
  gap: 7px;
}
.cd-bar-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #555;
}
.cd-bar-digits {
  display: flex;
  gap: 3px;
}
.cd-bar-card {
  position: relative;
  width: 42px;
  height: 58px;
}
.cd-bar-face {
  position: absolute;
  width: 100%;
  height: 100%;
  background: #1a1a1a;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #333;
  box-shadow: 0 2px 6px rgba(0,0,0,.45);
}
.cd-bar-face::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(0,0,0,.7);
  z-index: 10;
}
.cd-bar-face::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: rgba(0,0,0,.12);
  z-index: 9;
}
.cd-bar-num {
  font-size: 38px;
  font-weight: 700;
  color: #f5f5f0;
  line-height: 1;
  font-family: 'Courier New', monospace;
  user-select: none;
}
.cd-bar-unit-label {
  font-size: 10px;
  color: #888;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-family: sans-serif;
}
.cd-bar-label-bottom {
  font-size: 13px;
  color: #aaa;
  margin-top: .9rem;
  font-family: sans-serif;
}
.cd-bar-label-maturanti {
  font-size: 13px;
  color: #f0a500;
  margin-top: .4rem;
  font-family: sans-serif;
  font-style: italic;
}
.cd-bar-flip {
  animation: cdBarFlip .18s ease-in-out;
}
@keyframes cdBarFlip {
  0%   { transform: scaleY(1); }
  40%  { transform: scaleY(.05); }
  100% { transform: scaleY(1); }
}
@keyframes cdGoldPulse {
  0%, 100% { color: #f5f5f0; box-shadow: none; }
  50%      { color: #f0a500; box-shadow: 0 0 18px rgba(240,165,0,0.6); }
}
.cd-bar-finished .cd-bar-face,
.cd-bar-finished .cd-bar-num {
  animation: cdGoldPulse 1.5s ease-in-out infinite;
}


/* ===== YOUTUBE ===== */
.yt-dvojica {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.yt-embed-wrap {
  position: relative;
  width: 100%;
  max-width: 380px;
  flex: 1 1 280px;
  height: 0;
  padding-bottom: calc(min(380px, 45%) * 0.5625);
  border-radius: 8px;
  overflow: hidden;
}
.yt-embed-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}


/* ===== RASPORED (NASLOV I GRUPE) ===== */
.raspored-naslov {
  text-align: center;
  color: rgb(241, 138, 19);
  font-weight: bold;
  margin-top: 15px;
}
.rasporedi-grupe {
  text-align: center;
  margin-top: 10px;
}
.rasporedi-grupe a {
  color: red;
  font-weight: bold;
  text-decoration: none;
  margin: 0 6px;
}
.rasporedi-grupe a:hover { text-decoration: underline; }
.rasporedi-grupe p { margin: 8px 0; }


/* ===== KVIZ MODAL ===== */
.quiz-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(5px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}
.quiz-modal {
  background: white;
  border-radius: 28px;
  max-width: 450px;
  width: 100%;
  padding: 28px 24px;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}
.quiz-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #94a3b8;
}
.quiz-modal-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.quiz-modal-icon i {
  font-size: 32px;
  color: white;
}
.quiz-modal-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 4px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-align: center;
}
.quiz-modal-subtitle {
  font-size: 15px;
  color: #334155;
  margin-bottom: 20px;
  text-align: center;
}
.quiz-modal-description {
  color: #334155;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
  text-align: center;
}
.quiz-modal-note {
  background: #f0f9ff;
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #0f172a;
  line-height: 1.5;
  border: 1px solid rgba(37,99,235,0.2);
}
.quiz-modal-note i {
  color: #2563eb;
  font-size: 18px;
  flex-shrink: 0;
}
.quiz-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quiz-modal-btn {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: white;
  border: none;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 40px;
  width: 100%;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.quiz-modal-remind {
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 14px;
  cursor: pointer;
  padding: 12px 18px;
  border-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}


/* ===== WELCOME MODAL (Dan otvorenih vrata) ===== */
.welcome-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  z-index: 15000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.welcome-modal-overlay.open { display: flex; }

.welcome-modal {
  background: #fff;
  border-radius: 28px;
  max-width: 480px;
  width: 100%;
  padding: 32px 28px 24px;
  position: relative;
  box-shadow: 0 30px 60px rgba(0,0,0,0.3);
  text-align: center;
  animation: welcomePopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes welcomePopIn {
  0%   { opacity: 0; transform: scale(0.7) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.welcome-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  color: #94a3b8;
  line-height: 1;
}
.welcome-modal-close:hover { color: #475569; }

.welcome-modal-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #ff9800, #e65100);
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  box-shadow: 0 8px 20px rgba(230, 81, 0, 0.3);
}
.welcome-modal-icon i {
  font-size: 36px;
  color: #fff;
}

.welcome-modal-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #003f7f;
  font-family: 'Libre Baskerville', serif;
}
.welcome-modal-subtitle {
  font-size: 14px;
  color: #ff9800;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 18px;
}
.welcome-modal-message {
  color: #334155;
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 18px;
  font-family: 'Libre Baskerville', serif;
}
.welcome-modal-note {
  background: #fff8e1;
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 22px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #6d4c00;
  line-height: 1.5;
  border: 1px solid #ffe082;
  text-align: left;
}
.welcome-modal-note i {
  color: #ff9800;
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.welcome-modal-actions { display: flex; }

.welcome-modal-btn {
  background: linear-gradient(135deg, #ff9800, #e65100);
  color: white;
  border: none;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 40px;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.welcome-modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(230, 81, 0, 0.3);
}

[data-theme="dark"] .welcome-modal {
  background: #1e293b;
  color: #e2e8f0;
}
[data-theme="dark"] .welcome-modal-title { color: #60a5fa; }
[data-theme="dark"] .welcome-modal-message { color: #cbd5e1; }
[data-theme="dark"] .welcome-modal-note {
  background: rgba(255,152,0,0.1);
  border-color: rgba(255,152,0,0.3);
  color: #ffb74d;
}


/* ===== KALENDAR MODAL ===== */
#cal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  z-index: 11000;
  align-items: center;
  justify-content: center;
}
#cal-overlay.open { display: flex; }

#cal-box {
  background: #fff;
  border-radius: 20px;
  padding: 0;
  width: 96%;
  max-width: 700px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
}

#cal-topbar {
  background: linear-gradient(135deg, #005baa, #003f7f);
  color: #fff;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
#cal-topbar h2 {
  font-size: 20px;
  font-weight: bold;
  margin: 0;
}
#cal-topbar .cal-info-note {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 6px;
  font-family: sans-serif;
  font-style: italic;
  line-height: 1.4;
  max-width: 480px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
#cal-topbar .cal-info-note i {
  margin-top: 2px;
  flex-shrink: 0;
  opacity: 0.9;
}

#cal-datetime { text-align: right; }
#cal-clock {
  font-size: 28px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  letter-spacing: 2px;
}
#cal-datestr {
  font-size: 13px;
  opacity: 0.8;
  margin-top: 2px;
}

#cal-close-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 12px;
}
#cal-close-btn:hover { background: rgba(255,255,255,0.3); }

#cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 24px;
  border-bottom: 1px solid #eee;
  background: #f8f9fa;
  flex-shrink: 0;
}
.cal-leg {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #555;
}
.cal-leg-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

#cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}
#cal-nav button {
  background: #005baa;
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: background 0.2s;
}
#cal-nav button:hover { background: #003f7f; }
#cal-month-label {
  font-size: 18px;
  font-weight: bold;
  color: #003f7f;
}


/* ===== DUGME ZA DIJELJENJE (KALENDAR + RASPORED) + TOAST ===== */
.cal-share-btn {
  background: #28a745 !important;
  color: #fff !important;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  margin-left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s, transform 0.2s;
  font-family: inherit;
}
.cal-share-btn:hover {
  background: #218838 !important;
  transform: translateY(-1px);
}
.rasp-share-btn { margin-left: auto; }

#cal-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1a1a2e;
  color: #fff;
  padding: 12px 22px;
  border-radius: 30px;
  font-size: 14px;
  font-family: 'Libre Baskerville', serif;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 20000;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 90vw;
}
#cal-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#cal-toast i {
  color: #4ade80;
  font-size: 16px;
}
#cal-toast.error i { color: #f87171; }


/* ===== KALENDAR GRID ===== */
#cal-grid-wrap {
  overflow-y: auto;
  padding: 16px 24px 20px;
  flex: 1;
}
#cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  color: #888;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}
#cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.cal-day {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  cursor: default;
  position: relative;
  transition: transform 0.1s;
  border: 1.5px solid transparent;
  overflow: hidden;
}
.cal-day.has-event { cursor: pointer; }
.cal-day.has-event:hover {
  transform: scale(1.1);
  z-index: 5;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.cal-day.empty { background: transparent; }
.cal-day.weekend {
  background: #f0f0f0;
  color: #aaa;
}
.cal-day.normal {
  background: #fafafa;
  color: #333;
}
.cal-day.today {
  background: #005baa !important;
  color: #fff !important;
  border-color: #003f7f;
  font-weight: 700;
}

.cal-day.type-medjunarodni  { background: #e3f2fd; color: #1565c0; border-color: #90caf9; }
.cal-day.type-drzavni       { background: #ffebee; color: #c62828; border-color: #ef9a9a; }
.cal-day.type-vjerski       { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }
.cal-day.type-skolski       { background: #fff8e1; color: #f57f17; border-color: #ffe082; }
.cal-day.type-slobodan      { background: #f3e5f5; color: #6a1b9a; border-color: #ce93d8; }
.cal-day.type-roditeljski   { background: #e0f2f1; color: #00695c; border-color: #80cbc4; }
.cal-day.type-otvorenavrata { background: #fff3e0; color: #e65100; border-color: #ffb74d; }
.cal-day.type-vannastavne   { background: #fce4ec; color: #ad1457; border-color: #f48fb1; }

.cal-day.multi-event { border-style: solid; }
.cal-day .cal-day-num {
  font-size: 14px;
  line-height: 1;
  position: relative;
  z-index: 2;
}
.cal-day .cal-day-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  margin-top: 3px;
  opacity: 0.7;
  position: relative;
  z-index: 2;
}
.cal-day .cal-day-dots {
  display: flex;
  gap: 3px;
  margin-top: 3px;
  position: relative;
  z-index: 2;
}
.cal-day .cal-day-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  opacity: 0.85;
}


/* ===== KALENDAR POPUP ===== */
#cal-popup {
  position: fixed;
  background: #1a1a2e;
  color: #fff;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 14px;
  max-width: 280px;
  width: max-content;
  z-index: 12000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  display: none;
}
#cal-popup .cp-date {
  font-size: 11px;
  opacity: 0.6;
  margin-bottom: 8px;
}
#cal-popup .cp-title {
  font-weight: bold;
  font-size: 15px;
  margin-bottom: 6px;
}
#cal-popup .cp-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: bold;
  align-self: flex-start;
}

#cal-popup .cp-line {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 10px;
}
#cal-popup .cp-line:last-child { margin-bottom: 0; }

#cal-popup .cp-badge.medjunarodni  { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }
#cal-popup .cp-badge.drzavni       { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
#cal-popup .cp-badge.vjerski       { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
#cal-popup .cp-badge.skolski       { background: #fff8e1; color: #f57f17; border: 1px solid #ffe082; }
#cal-popup .cp-badge.slobodan      { background: #f3e5f5; color: #6a1b9a; border: 1px solid #ce93d8; }
#cal-popup .cp-badge.roditeljski   { background: #e0f2f1; color: #00695c; border: 1px solid #80cbc4; }
#cal-popup .cp-badge.otvorenavrata { background: #fff3e0; color: #e65100; border: 1px solid #ffb74d; }
#cal-popup .cp-badge.vannastavne   { background: #fce4ec; color: #ad1457; border: 1px solid #f48fb1; }


/* ===== INTERESANTNOSTI MODAL ===== */
#res-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  z-index: 11000;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 10px;
  overflow-y: auto;
}
#res-overlay.open { display: flex; }

#res-box {
  background: #fff;
  border-radius: 20px;
  padding: 0;
  width: 100%;
  max-width: 820px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.3);
  overflow: hidden;
  margin: auto;
}

#res-header {
  background: linear-gradient(135deg, #003f7f, #005baa);
  color: #fff;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#res-header h2 {
  font-size: 22px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
#res-header p {
  font-size: 13px;
  opacity: 0.75;
  margin-top: 4px;
}

#res-close-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#res-close-btn:hover { background: rgba(255,255,255,0.3); }

#res-body { padding: 24px 28px; }

.res-section { margin-bottom: 28px; }
.res-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: bold;
  color: #003f7f;
  border-bottom: 2px solid #e8f0fe;
  padding-bottom: 8px;
  margin-bottom: 14px;
}
.res-section-title i {
  color: #0071ce;
  font-size: 18px;
}

.res-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.res-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fafcff;
}
.res-card:hover {
  box-shadow: 0 6px 20px rgba(0,91,170,0.12);
  transform: translateY(-2px);
}
.res-card-name {
  font-size: 14px;
  font-weight: bold;
  color: #003f7f;
  display: flex;
  align-items: center;
  gap: 8px;
}
.res-card-name i {
  color: #0071ce;
  width: 16px;
  text-align: center;
}
.res-card-desc {
  font-size: 12px;
  color: #666;
  line-height: 1.5;
  flex: 1;
}
.res-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #0071ce;
  color: #fff;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: bold;
  margin-top: 4px;
  width: fit-content;
  transition: background 0.2s;
}
.res-card-btn:hover { background: #005baa; }
.res-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.res-card-share {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  width: fit-content;
}
.res-card-share:hover { background: #e2e8f0; color: #1e293b; }
.res-card-share.copied { background: #d1fae5; color: #065f46; border-color: #10b981; }

#res-suggest {
  background: #f0f7ff;
  border: 1px solid #b3d4f5;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 8px;
}
#res-suggest i {
  color: #0071ce;
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}
#res-suggest div {
  font-size: 13px;
  color: #334155;
  line-height: 1.6;
}
#res-suggest a {
  color: #0071ce;
  font-weight: bold;
}


/* ===== ZOOM OVERLAY NA SLIKAMA ===== */
.img-zoom-wrap {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.img-zoom-wrap img {
  width: 100%;
  display: block;
  transition: transform .3s ease;
}
.img-zoom-wrap:hover img {
  transform: scale(1.07);
}
.img-zoom-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
  pointer-events: none;
}
.img-zoom-wrap:hover .img-zoom-icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ============================================================
   RESPONZIVNOST
   ============================================================ */

@media (max-width: 768px) {
  .album-images { grid-template-columns: repeat(3,1fr); }
  .main-nav {
    flex-direction: column;
    gap: 10px;
  }
  .kuca-slavnih-galerija { grid-template-columns: repeat(2, 1fr); }
  .rasp-meta {
    font-size: 0.75rem;
    padding: 4px 10px;
  }
  .rasp-picker {
    flex-direction: column;
    align-items: stretch;
  }
  .rasp-day-info {
    margin-left: 0;
    text-align: center;
  }

  /* Naslov škole na mobitelu — manji + prostor za dark mode dugme */
  .school-name {
    font-size: 22px;
    padding: 0 55px;
    line-height: 1.25;
  }
  .theme-toggle {
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  /* Mobilni kalendar — cijeli modal scrolla, ne samo grid */
  #cal-overlay {
    align-items: flex-start;
    overflow-y: auto;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
  }
  #cal-box {
    max-height: none;
    overflow: visible;
    margin: 10px auto;
  }
  #cal-grid-wrap {
    overflow-y: visible;
    max-height: none;
    flex: none;
  }

  /* Topbar kalendara — kompaktniji */
  #cal-topbar {
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 10px;
    position: relative;
  }
  #cal-topbar h2 { font-size: 17px; }
  #cal-topbar .cal-info-note {
    font-size: 11px;
    max-width: 100%;
  }
  #cal-clock {
    font-size: 22px;
    letter-spacing: 1px;
  }
  #cal-datetime { text-align: left; }
  #cal-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    margin-left: 0;
  }

  /* Legenda — kompaktnija */
  #cal-legend {
    padding: 8px 14px;
    gap: 5px 10px;
  }
  .cal-leg { font-size: 11px; }
  .cal-leg-dot {
    width: 10px;
    height: 10px;
  }

  #res-body { padding: 16px; }
  .res-cards { grid-template-columns: 1fr 1fr; }
  .cd-bar-card {
    width: 26px;
    height: 38px;
  }
  .cd-bar-num { font-size: 22px; }
  .post-images { flex-direction: column; }
  .post-images .post-img { width: 100%; }

  /* Dugme galerije — malo manje na mobitelu */
  .goto-gallery-btn {
    padding: 9px 18px;
    font-size: 15px;
  }
}

@media (max-width: 500px) {
  .album-images { grid-template-columns: repeat(2,1fr); }
  .kuca-slavnih-galerija { grid-template-columns: 1fr; }
  .res-cards { grid-template-columns: 1fr; }
  .rasp-subject { flex-wrap: wrap; }
  .rasp-time { min-width: 100%; }
  #cal-nav {
    flex-wrap: wrap;
    gap: 8px;
  }
  .cal-share-btn {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
  .rasp-share-btn {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
}