* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #020806;
  color: #FFFFFF;
  user-select: none;
  -webkit-user-select: none;
}

/* ========================================================
   1. KİLİT EKRANI (Lisans Girişi)
   ======================================================== */
.license-container {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at 50% 20%, #064e3b 0%, #031c15 55%, #010a07 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.license-card {
  width: 100%;
  max-width: 390px;
  background: rgba(11, 33, 27, 0.95);
  border: 1.5px solid rgba(52, 211, 153, 0.35);
  border-radius: 24px;
  padding: 32px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), 0 0 30px rgba(16, 185, 129, 0.15);
  text-align: center;
}

.license-icon {
  font-size: 42px;
  margin-bottom: 12px;
}

.license-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fbbf24;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  margin-bottom: 12px;
}

.license-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
  color: #FFFFFF;
}

.license-subtitle {
  font-size: 13.5px;
  line-height: 1.5;
  color: #94a3b8;
  margin-bottom: 24px;
}

.license-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.license-form input {
  width: 100%;
  padding: 15px 16px;
  border-radius: 14px;
  border: 1.5px solid rgba(52, 211, 153, 0.45);
  background: rgba(4, 15, 12, 0.9);
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.license-form input:focus {
  border-color: #10b981;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.license-form button {
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #FFFFFF;
  font-size: 15.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.35);
  transition: transform 0.15s, opacity 0.2s;
}

.license-form button:active {
  transform: scale(0.98);
}

.license-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.license-status {
  margin-top: 14px;
  font-size: 13.5px;
  font-weight: 600;
  min-height: 20px;
  line-height: 1.4;
}

.license-status.success {
  color: #34d399;
}

.license-status.error {
  color: #f87171;
}

.license-info-note {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

/* ========================================================
   2. KİTAP OKUYUCU (Reader UI)
   ======================================================== */
.reader-container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #06130f;
  position: relative;
}

.reader-header {
  height: 54px;
  background: rgba(11, 33, 27, 0.95);
  border-bottom: 1px solid rgba(52, 211, 153, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  z-index: 10;
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  color: #ecfdf5;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-badge {
  font-size: 12.5px;
  font-weight: 600;
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.15);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* Book Stage & Canvas */
.book-stage {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #020806;
  padding: 10px;
  touch-action: pan-y;
}

.canvas-wrapper {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

#pdf-canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.page-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  color: #6ee7b7;
  display: none;
}

/* Reader Footer */
.reader-footer {
  height: 60px;
  background: rgba(11, 33, 27, 0.95);
  border-top: 1px solid rgba(52, 211, 153, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 12px;
  flex-shrink: 0;
  z-index: 10;
}

.nav-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  flex-shrink: 0;
}

.nav-btn:active {
  transform: scale(0.96);
}

.slider-box {
  flex: 1;
  display: flex;
  align-items: center;
}

.slider-box input[type="range"] {
  width: 100%;
  accent-color: #10b981;
  cursor: pointer;
}

/* Reading Modes (Themes) */
body.theme-sepia .reader-container {
  background: #2b251d;
}
body.theme-sepia .reader-header,
body.theme-sepia .reader-footer {
  background: #3d352a;
  border-color: rgba(217, 119, 6, 0.25);
}
body.theme-sepia .canvas-wrapper {
  filter: sepia(0.35) contrast(0.95);
}

body.theme-night .reader-container {
  background: #000000;
}
body.theme-night .reader-header,
body.theme-night .reader-footer {
  background: #111111;
  border-color: #222222;
}
body.theme-night .canvas-wrapper {
  filter: invert(0.9) hue-rotate(180deg);
}

/* ========================================================
   3. YAZARIN NOTU & DUYURU SİSTEMİ
   ======================================================== */
.announcement-trigger {
  position: relative;
  font-size: 14px;
}

.notification-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  background: #ef4444;
  border: 1.5px solid #064e3b;
  border-radius: 50%;
  animation: pulseDot 1.6s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.8; }
}

.announcement-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.announcement-card {
  width: 100%;
  max-width: 420px;
  background: #092019;
  border: 1.5px solid rgba(52, 211, 153, 0.4);
  border-radius: 22px;
  padding: 26px 22px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(16, 185, 129, 0.2);
  animation: popupAnim 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popupAnim {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.announcement-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.announcement-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.1px;
  color: #34d399;
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.3);
  padding: 4px 10px;
  border-radius: 999px;
}

.announcement-x-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.announcement-x-btn:hover {
  color: #FFFFFF;
}

.announcement-title {
  font-size: 19px;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 10px;
}

.announcement-body {
  font-size: 14px;
  line-height: 1.6;
  color: #cbd5e1;
  white-space: pre-wrap;
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.announcement-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 16px;
  gap: 12px;
}

.announcement-date {
  font-size: 11.5px;
  color: #64748b;
  font-weight: 500;
}

.announcement-ok-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  transition: transform 0.1s ease;
}

.announcement-ok-btn:active {
  transform: scale(0.96);
}
