
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #111;
  color: #f8f8f8;
}
.viewer-root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.viewer-header, .viewer-footer {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.viewer-header {
  background: rgba(0, 0, 0, 0.85);
  border-bottom: 1px solid #2a2a2a;
}
.viewer-footer {
  background: rgba(0, 0, 0, 0.85);
  border-top: 1px solid #2a2a2a;
  font-size: 12px;
  color: #bbbbbb;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #f8f8f8;
  color: #000;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-meta {
  display: flex;
  flex-direction: column;
}
.brand-title {
  font-size: 16px;
  font-weight: 600;
}
.brand-subtitle {
  font-size: 12px;
  color: #bbbbbb;
}
.pager {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pager-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid #333;
  background: #1c1c1c;
  color: #f8f8f8;
  font-size: 18px;
  cursor: pointer;
}
.pager-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
#pageIndicator {
  font-size: 14px;
}

.viewer-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}
.page-frame {
  width: 100%;
  max-width: min(90vw, 80vh * 0.707); /* A4 omjer (210x297 ~ 0.707) */
  aspect-ratio: 210 / 297;
  background: #222;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.page-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

/* Mali ekrani */
@media (max-width: 600px) {
  .viewer-header, .viewer-footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .pager {
    align-self: stretch;
    justify-content: space-between;
  }
}
