/* ==========================================================================
   GÜRSOY GRUP - DİJİTAL FLIPBOOK / E-KATALOG STİL DOSYASI
   Ultra-modern, glassmorphic luxury automotive UI
   ========================================================================== */

:root {
  --bg-primary: #0e1117;
  --bg-secondary: #161a21;
  --bg-surface: rgba(20, 23, 29, 0.92);
  --bg-surface-hover: rgba(40, 44, 52, 0.95);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(196, 168, 120, 0.35);
  --text-main: #e8e8ea;
  --text-muted: #9a9ca3;
  --accent-gold: #c4a878;
  --accent-gold-glow: rgba(196, 168, 120, 0.15);
  --accent-blue: #0284c7;
  --accent-cyan: #38bdf8;
  --shadow-book: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 50px rgba(0, 0, 0, 0.5);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 9999px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  user-select: none;
  -webkit-user-select: none;
}

button, input {
  font-family: inherit;
}

/* GoMobility theme: brochure slate + yellow accent */
body[data-catalog="gomobility"] {
  --bg-surface: rgba(52, 62, 73, 0.95);
  --bg-surface-hover: rgba(72, 84, 97, 0.95);
  --accent-gold: #f2b705;
  --accent-gold-glow: rgba(242, 183, 5, 0.15);
  --text-muted: #b4bcc6;
}
body[data-catalog="gomobility"] .app-container {
  background: radial-gradient(circle at 50% 40%, #56636f 0%, #3f4a56 55%, #2e3740 100%);
}

/* Ambient dynamic background */
.app-container {
  position: relative;
  transition: background 0.4s ease;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 40%, #1b1e24 0%, #121418 60%, #0b0c0f 100%);
  overflow: hidden;
}

.ambient-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80vw;
  height: 70vh;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.03) 0%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

/* ==========================================================================
   TOP BAR / HEADER
   ========================================================================== */
.top-header {
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  height: 64px;
  flex-shrink: 0;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-logo {
  height: 30px;
  width: auto;
  display: block;
}

.catalog-switch {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
}

.catalog-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.catalog-btn:hover { color: var(--text-main); }

.catalog-btn.active {
  background: var(--accent-gold);
  color: #14161a;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.btn-icon:hover {
  background: var(--bg-surface-hover);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-icon:active {
  transform: translateY(0);
}

.btn-icon.active {
  background: var(--accent-gold);
  color: #0b0f19;
  border-color: var(--accent-gold);
}

.btn-icon.active svg {
  fill: #0b0f19;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Tooltip */
.tooltip-wrap {
  position: relative;
}

.tooltip-wrap:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1d23;
  color: #f1f5f9;
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 100;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -4px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ==========================================================================
   MAIN BOOK STAGE
   ========================================================================== */
.main-stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 0;
  padding: 24px 90px;
  z-index: 10;
}

.book-viewport {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  transition: transform var(--transition-fast);
}

/* Flipbook Container */
.flipbook-wrap {
  position: relative;
  box-shadow: var(--shadow-book);
  border-radius: 6px;
}

.page {
  background-color: #0d111a;
  overflow: hidden;
  position: relative;
}

.page img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  user-select: none;
  pointer-events: none;
}

/* Hard cover spine effect */
.page-cover {
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.7);
}

.page-cover-top {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}

.page-cover-bottom {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

/* Cover / back cover: center the single page instead of leaving an empty half */
.flipbook-wrap {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.book-viewport.is-cover .flipbook-wrap { transform: translateX(-25%); }
.book-viewport.is-back .flipbook-wrap { transform: translateX(25%); }
.book-viewport.is-cover .flipbook-wrap::after,
.book-viewport.is-back .flipbook-wrap::after,
.book-viewport.is-portrait .flipbook-wrap::after { display: none; }
.flipbook-wrap, .book-viewport.is-cover .flipbook-wrap, .book-viewport.is-back .flipbook-wrap { box-shadow: none; }
.stf__block { filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.6)); }

/* Middle gutter shadow between pages */
.flipbook-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 30px;
  transform: translateX(-50%);
  background: linear-gradient(to right, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.05) 40%, rgba(0,0,0,0.05) 60%, rgba(0,0,0,0.3) 100%);
  pointer-events: none;
  z-index: 25;
}

/* Floating Navigation Arrows */
.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(30, 33, 40, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 40;
  transition: all var(--transition-fast);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.nav-arrow:hover {
  background: var(--accent-gold);
  color: #0b0f19;
  border-color: var(--accent-gold);
  transform: translateY(-50%) scale(1.05);
}

.nav-arrow:active {
  transform: translateY(-50%) scale(0.96);
}

.nav-arrow.prev {
  left: 20px;
}

.nav-arrow.next {
  right: 20px;
}

.nav-arrow svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Corner Click Overlays for easy flipping */
.flip-corner-hint {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 15%;
  z-index: 30;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.flip-corner-hint.left {
  left: 0;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.04), transparent);
}

.flip-corner-hint.right {
  right: 0;
  background: linear-gradient(to left, rgba(255, 255, 255, 0.04), transparent);
}

.flip-corner-hint:hover {
  opacity: 1;
}

/* ==========================================================================
   BOTTOM DOCK / TOOLBAR
   ========================================================================== */
.bottom-dock {
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-glass);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  height: 64px;
  flex-shrink: 0;
}

.dock-left, .dock-right { flex: 1; }
.dock-right { justify-content: flex-end; }

/* Tooltips in the bottom dock open upwards */
.bottom-dock .tooltip-wrap:hover::after {
  top: auto;
  bottom: calc(100% + 8px);
}

.dock-left, .dock-center, .dock-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Page Indicator & Scrub Bar */
.page-scrub-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.35);
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-glass);
}

.page-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.page-input {
  width: 64px;
  height: 28px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #fff;
  text-align: center;
  font-weight: 600;
  font-size: 0.85rem;
}

.page-input:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 8px var(--accent-gold-glow);
}

.page-scrubber {
  -webkit-appearance: none;
  width: 140px;
  height: 5px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.page-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-gold);
  cursor: pointer;
  box-shadow: 0 0 10px var(--accent-gold-glow);
  transition: transform 0.1s;
}

.page-scrubber::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

/* Zoom Controls */
.zoom-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 40px;
  background: rgba(0, 0, 0, 0.35);
  padding: 0 5px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-glass);
}

.zoom-bar .btn-icon {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
}

.zoom-bar .btn-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  transform: none;
}

#btnZoomReset {
  width: auto;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.35);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

#btnZoomReset:hover {
  color: var(--text-main);
  transform: none;
}

.zoom-level-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 44px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* ==========================================================================
   THUMBNAILS DRAWER (SLIDE UP)
   ========================================================================== */
.thumbs-drawer {
  position: absolute;
  bottom: 64px;
  left: 0;
  right: 0;
  background: rgba(18, 20, 25, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-glass);
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-normal);
  z-index: 45;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.6);
}

.thumbs-drawer.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.thumbs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.thumbs-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

.thumbs-scroll {
  display: flex;
  align-items: center;
  gap: 14px;
  overflow-x: auto;
  padding: 8px 4px 12px 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.thumbs-scroll::-webkit-scrollbar {
  height: 6px;
}

.thumbs-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.thumb-item {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.thumb-item:hover {
  transform: translateY(-4px);
}

.thumb-img-wrap {
  width: 90px;
  height: 64px;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: #22252b;
  transition: all var(--transition-fast);
}

.thumb-item.active .thumb-img-wrap {
  border-color: var(--accent-gold);
  box-shadow: 0 0 15px var(--accent-gold-glow);
  transform: scale(1.06);
}

.thumb-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-number {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.thumb-item.active .thumb-number {
  color: var(--accent-gold);
  font-weight: 700;
}

/* ==========================================================================
   TABLE OF CONTENTS (İÇİNDEKİLER) SIDEBAR MODAL
   ========================================================================== */
.toc-sidebar {
  position: absolute;
  top: 64px;
  left: 0;
  bottom: 64px;
  width: 380px;
  max-width: 90vw;
  background: rgba(18, 20, 25, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-glass);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.7);
  z-index: 48;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
}

.toc-sidebar.open {
  transform: translateX(0);
}

.toc-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toc-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toc-search-wrap {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.2);
}

.toc-search-input {
  width: 100%;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.85rem;
  outline: none;
  transition: all var(--transition-fast);
}

.toc-search-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 10px var(--accent-gold-glow);
}

.toc-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.toc-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(4px);
}

.toc-item.active {
  background: rgba(196, 168, 120, 0.08);
  border-color: var(--accent-gold);
}

.toc-item-title {
  font-size: 0.86rem;
  color: var(--text-main);
  font-weight: 500;
}

.toc-item.active .toc-item-title {
  color: var(--accent-gold);
  font-weight: 700;
}

.toc-item-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.toc-item.active .toc-item-badge {
  background: var(--accent-gold);
  color: #0b0f19;
  font-weight: 700;
}

/* ==========================================================================
   HELP & SHORTCUTS MODAL
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 520px;
  max-width: 90vw;
  background: #16191f;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transform: scale(0.92);
  transition: transform var(--transition-normal);
}

.modal-backdrop.open .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
}

.shortcut-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.shortcut-key {
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.15);
  padding: 3px 8px;
  border-radius: 4px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   NOTIFICATION TOAST
   ========================================================================== */
.toast-notice {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1f2228;
  border: 1px solid var(--accent-gold);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-fast);
  z-index: 90;
}

.toast-notice.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 900px) {
  .top-header {
    padding: 8px 14px;
    height: 56px;
  }
  .main-stage {
    padding: 12px;
  }
  .bottom-dock {
    padding: 8px 12px;
    height: 56px;
  }
  .page-scrubber {
    display: none;
  }
  .zoom-bar {
    display: none;
  }
  .nav-arrow {
    width: 38px;
    height: 38px;
  }
  .nav-arrow.prev { left: 6px; }
  .nav-arrow.next { right: 6px; }
  .brand-logo { height: 24px; }
  .toc-sidebar { top: 56px; bottom: 56px; }
  .thumbs-drawer { bottom: 56px; }
}

@media (max-width: 900px) {
  .top-header { height: auto; flex-wrap: wrap; row-gap: 8px; }
  .catalog-switch { position: static; transform: none; order: 3; width: 100%; justify-content: center; }
  .catalog-btn { flex: 1; padding: 6px 10px; font-size: 0.75rem; }
  .toc-sidebar { top: 0; bottom: 0; z-index: 60; }
}

@media (max-width: 600px) {
  .header-actions { gap: 6px; }
  #btnHelp, #btnShare, #dockFirst, #dockLast, .dock-center {
    display: none;
  }
  .btn-icon { width: 36px; height: 36px; }
  .bottom-dock {
    justify-content: center;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    height: auto;
  }
  .dock-left { flex: 0 1 auto; gap: 8px; }
  .dock-right { display: none; }
  .page-scrub-wrap { padding: 4px 12px; }
  .page-input-wrap > span:first-child { display: none; }
  .nav-arrow { display: none; }
  .toc-sidebar { width: 100%; max-width: 100%; }
  .tooltip-wrap:hover::after { display: none; }
}
