* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, #2b3137 0%, #1b1f24 38%, #101215 100%);
  color: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 5px 22px;
  background: #323e47;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand-logo {
  width: 170px;
  height: auto;
  max-height: 70px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  background: transparent;
  border-radius: 0;
  padding: 0;
}

.brand-text {
  min-width: 0;
}

.title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.page-info {
  margin-top: 4px;
  font-size: 13px;
  color: #d8e0e6;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.controls button,
.bottombar button {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, #434f58, #2d3840);
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.2s ease;
}

.controls button:hover,
.bottombar button:hover {
  background: linear-gradient(180deg, #4b5862, #344048);
}

.book-shell {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 22px 12px;
  overflow: hidden;
}

.book-stage {
  position: relative;
  width: min(1500px, 96vw);
  height: min(920px, 78vh);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

#flipbook {
  width: 100%;
  height: 100%;
  transform-origin: center center;
  transition: transform 0.2s ease;
  filter: drop-shadow(0 28px 60px rgba(0, 0, 0, 0.55));
}

#hotspotsLayer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  display: block;
  pointer-events: auto;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.001);
  border: 2px solid rgba(124, 196, 66, 0);
  transition: 0.2s ease;
}

.hotspot:hover {
  border-color: rgba(124, 196, 66, 0.95);
  background: rgba(124, 196, 66, 0.12);
}

.page {
  background: #ffffff;
  overflow: hidden;
}

.page.cover {
  background: linear-gradient(180deg, #ffffff, #f3f3f3);
}

.page img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #ffffff;
  user-select: none;
  -webkit-user-drag: none;
}

.bottombar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 18px;
  flex-wrap: wrap;
}

#pageInput {
  width: 90px;
  padding: 10px 12px;
  text-align: center;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: #1b2025;
}

#zoomInfo {
  color: #d0d8de;
  min-width: 58px;
  text-align: center;
}

.whatsapp-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25d366;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
  z-index: 150;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.whatsapp-float:hover {
  transform: scale(1.06);
}

.whatsapp-float svg {
  width: 30px;
  height: 30px;
}

@media (max-width: 1100px) {
  .brand-logo {
    width: 170px;
  }

  .title {
    font-size: 18px;
  }
}

@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .brand-logo {
    width: 170px;
    max-width: 100%;
    max-height: none;
  }

  .controls {
    justify-content: flex-start;
  }

  .book-stage {
    width: 96vw;
    height: 72vh;
  }
}

@media (max-width: 600px) {
  .brand-logo {
    width: 150px;
  }

  .controls button,
  .bottombar button {
    padding: 9px 12px;
    font-size: 14px;
  }

  .whatsapp-float {
    width: 52px;
    height: 52px;
    right: 14px;
    bottom: 14px;
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(90deg, #1c2430, #3f4d5d);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: 64px;
  box-sizing: border-box;
  flex-wrap: nowrap; /* ikinci satırı engeller */
}

.topbar-left,
.topbar-center,
.topbar-right {
  display: flex;
  align-items: center;
  min-width: 0;
}

.topbar-left {
  flex: 1 1 auto;
  overflow: hidden;
  gap: 8px;
}

.topbar-center {
  flex: 0 0 auto;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.topbar-right {
  flex: 0 0 auto;
  gap: 6px;
}

.topbar-logo {
  height: 34px;
  width: auto;
  flex: 0 0 auto;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-btn,
.more-btn {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-radius: 10px;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.mobile-menu {
  display: none;
  position: absolute;
  top: 70px;
  right: 12px;
  z-index: 1100;
  background: #253140;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}

.mobile-menu.open {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-menu button {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
}

@media (max-width: 768px) {
  .topbar {
    padding: 8px 10px;
    min-height: 56px;
  }

  .topbar-logo {
    height: 28px;
  }

  .topbar-title {
    font-size: 14px; /* sığmazsa küçülür */
  }

  .topbar-center {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .topbar {
    gap: 6px;
  }

  .topbar-left {
    gap: 6px;
  }

  .topbar-logo {
    height: 24px;
  }

  .topbar-title {
    font-size: 12px;
    max-width: 110px;
  }

  .topbar-center {
    font-size: 12px;
  }

  .nav-btn,
  .more-btn {
    width: 32px;
    height: 32px;
    font-size: 20px;
    border-radius: 8px;
  }
}

/* Mobil üst bar düzeni */
@media (max-width: 768px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    min-height: 56px;
  }

  .topbar-left {
    min-width: 0;
    gap: 6px;
    overflow: hidden;
  }

  .topbar-logo {
    height: 28px;
    flex-shrink: 0;
  }

  .topbar-title {
    font-size: 13px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-center {
    min-width: 0;
    font-size: 12px;
    justify-self: center;
  }

  .topbar-right {
    gap: 4px;
  }

  .nav-btn,
  .more-btn {
    width: 32px;
    height: 32px;
    font-size: 18px;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .mobile-menu {
    top: 58px;
    right: 10px;
  }
}

@media (max-width: 600px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
    padding: 7px 8px;
  }

  .topbar-logo {
    height: 24px;
  }

  .topbar-title {
    font-size: 11px;
    max-width: 110px;
  }

  .topbar-center {
    font-size: 11px;
  }

  .topbar-right .more-btn {
    display: inline-flex;
  }
}

@media (max-width: 430px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .topbar-title {
    font-size: 10px;
    max-width: 86px;
  }

  .topbar-center {
    font-size: 10px;
  }

  .nav-btn,
  .more-btn {
    width: 30px;
    height: 30px;
    font-size: 17px;
  }
}
