/* ========================== RESET & GLOBAL ========================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #ebebeb;
  color: #222;
  line-height: 1.5;
}

/* ========================== NAV ========================== */

nav {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;

  gap: 12px;

  padding: 14px;

  border-bottom: 1px solid #ddd;
}

nav a {
  text-decoration: none;
  color: #333;
  font-weight: 600;

  font-size: clamp(14px, 3vw, 20px);
}

/* ========================== BANNER ========================== */

.banner-link {
  display: flex;
  justify-content: center;
  width: 100%;
}

.banner {
  width: 100%;
  height: auto;
  display: block;
  max-width: 1600px;
}

/* ========================== READER ========================== */

.reader-container {
  width: 100%;
  max-width: 1400px;

  margin: 0 auto;

  padding: 10px;

  display: flex;
  flex-direction: column;
  align-items: center;
}

.reader {
  width: 100%;

  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ========================== BUTTON NAV ========================== */

.top-navigation,
.bottom-navigation {
  width: 100%;

  display: flex;
  justify-content: center;
  flex-wrap: wrap;

  gap: 8px;

  margin: 10px 0;
}

.navigation button {
  font-size: 20px;
  min-width: 44px;
  min-height: 44px;
}

.navigation button:hover {
  background: #fffcfc;
}

/* ========================== PAGE SELECTOR ========================== */

.page-selector {
  margin: 10px 0;

  display: flex;
  flex-wrap: wrap;
  gap: 10px;

  justify-content: center;
  align-items: center;
}

.page-selector select {
  padding: 8px;
  font-size: 14px;
}

/* ========================== READER IMAGE ========================== */

#reader-image {
  width: 100%;
  max-width: 1240px;

  height: auto;

  display: block;

  border-radius: 6px;

  object-fit: contain;

  transition: opacity 0.15s ease, transform 0.25s ease;
}

/* ========================== ZOOM ========================== */

.zoom-control {
  position: fixed;

  bottom: 15px;
  right: 12px;

  display: flex;
  flex-direction: column;
  align-items: center;

  gap: 6px;

  z-index: 1200;
}

.zoom-label {
  font-size: 12px;
  font-weight: bold;

  background: rgba(0,0,0,0.75);
  color: #fff;

  padding: 4px 8px;

  border-radius: 6px;
}

/* ZOOM STATE */
.reader.zoomed #reader-image {
  width: 125% !important;
  max-width: none !important;
}

#zoom-toggle {
  width: 50px;
  height: 50px;

  border-radius: 50%;
  border: none;

  background: #222;
  color: #fff;

  font-size: 14px;
  font-weight: bold;

  cursor: pointer;
}

/* ========================== THANK YOU SECTION ========================== */

.thankyou-section {
  width: 100%;

  padding: 50px 12px;

  display: flex;
  flex-direction: column;
  align-items: center;
}

.thankyou-title {
  text-align: center;

  font-size: clamp(26px, 5vw, 48px);
  font-weight: 800;

  margin-bottom: 25px;
}

/* ========================== TABLE ========================== */

.message-list-wrapper {
  width: 100%;
  max-width: 1000px;

  height: 480px;

  display: flex;
  flex-direction: column;

  background: #fff;

  border-radius: 10px;

  box-shadow: 0 10px 25px rgba(0,0,0,0.2);

  overflow: hidden;
}

.message-list-header,
.message-row {
  display: grid;

  grid-template-columns: 40px 140px 1fr;

  align-items: start;
  gap: 10px;
}

.message-list-header {
  background: #222;
  color: #fff;

  font-weight: bold;

  padding: 12px;
}

.message-list-body {
  flex: 1;
  overflow-y: auto;
}

.message-row {
  padding: 12px;
  border-bottom: 1px solid #eee;

  font-size: 14px;
}

.message-row:nth-child(even) {
  background: #f6f6f6;
}

.message-cell {
  word-break: break-word;
}

/* ========================== FOOTER ========================== */

footer {
  text-align: center;

  padding: 20px;

  font-size: 14px;

  border-top: 1px solid #ddd;
}

/* ========================== MOBILE ========================== */

@media (max-width: 768px) {

  .navigation button {
    flex: 1 1 calc(50% - 10px);
    font-size: 12px;
  }

  .message-list-header,
  .message-row {
    grid-template-columns: 30px 90px 1fr;
    font-size: 12px;
  }

  .message-list-wrapper {
    height: 420px;
  }
}

/* ========================== SMALL PHONES ========================== */

@media (max-width: 480px) {

  .navigation button {
    flex: 1 1 100%;
  }

  .page-selector {
    flex-direction: column;
    width: 100%;
  }

  .page-selector select {
    width: 100%;
  }

  .message-list-header,
  .message-row {
    grid-template-columns: 28px 80px 1fr;
    font-size: 11px;
  }
}