/* ===============================
   THE LEADERS · MAGAZINE READER
   FINAL PRODUCTION CSS
================================ */

/* RESET */
* {
  box-sizing: border-box;
}

/* ===============================
   BASE
================================ */
body {
  margin: 0;
  font-family: Inter, sans-serif;
  background: #0b0b0b;
  color: #fff;
  overflow: hidden;
}

/* ===============================
   HEADER
================================ */
.reader-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 24px;
  background: #111;
  border-bottom: 1px solid #222;
  height: 64px;
}

.reader-header .back {
  color: #c08a3c;
  text-decoration: none;
  font-size: 14px;
}

.reader-header h1 {
  font-size: 18px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===============================
   VIEWER (CORE)
================================ */
.viewer {
  display: flex;
  justify-content: center;
  align-items: center;
  height: calc(100vh - 64px);
  background: #000;
  gap: 24px;
  padding: 24px;
  overflow: hidden; /* penting untuk swipe */
  will-change: transform;
}

/* ===============================
   PAGES (IMAGES)
================================ */
.viewer img {
  max-height: 100%;
  max-width: 48%;
  object-fit: contain;
  background: #000;
  box-shadow: 0 0 40px rgba(0,0,0,0.6);
  border-radius: 4px;
  user-select: none;
  pointer-events: none;
}

/* SINGLE PAGE (COVER / MOBILE) */
.viewer img.single {
  max-width: 60%;
}

/* HIDDEN PAGE */
.viewer img.hidden {
  display: none !important;
}

/* ===============================
   PAGINATION
================================ */
.pagination {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 10;
}

.pagination button {
  background: none;
  border: none;
  color: #c08a3c;
  font-size: 14px;
  cursor: pointer;
}

.pagination button:disabled {
  opacity: 0.3;
  cursor: default;
}

.page-info {
  color: #ccc;
  min-width: 140px;
  text-align: center;
}

/* ===============================
   MOBILE OPTIMIZATION
================================ */
@media (max-width: 1024px) {
  .viewer {
    padding: 16px;
  }

  .viewer img {
    max-width: 90%;
  }

  .viewer img.single {
    max-width: 90%;
  }
}

/* ===============================
   SWIPE ANIMATION
================================ */

.viewer.swiping {
  transition: none;
}

.viewer.animate-left {
  animation: swipeLeft 0.35s ease-out;
}

.viewer.animate-right {
  animation: swipeRight 0.35s ease-out;
}

@keyframes swipeLeft {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

@keyframes swipeRight {
  from { transform: translateX(0); }
  to   { transform: translateX(100%); }
}

/* ===============================
   FULLSCREEN MODE
================================ */

body.fullscreen {
  cursor: none;
}

body.fullscreen .reader-header,
body.fullscreen .pagination {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

body.show-ui .reader-header,
body.show-ui .pagination {
  opacity: 1;
  pointer-events: auto;
}

/* Fullscreen button */
/* Fullscreen Button */
.fs-btn {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(192,138,60,0.12);
  border: 1px solid rgba(192,138,60,0.35);
  border-radius: 999px;
  color: #c08a3c;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.fs-btn:hover {
  background: rgba(192,138,60,0.25);
}

.fs-icon {
  font-size: 16px;
  line-height: 1;
}

.fs-text {
  white-space: nowrap;
}

/* Hide text on very small screens */
@media (max-width: 480px) {
  .fs-text {
    display: none;
  }
}

/* Viewer benar-benar fullscreen */
body.fullscreen .viewer {
  height: 100vh;
  padding: 32px;
}
