/* ===============================
   BASE / LAYOUT
================================ */

html, body {
  height: 100%;
  margin: 0;
}

.full-height {
  min-height: 100dvh;
}

.hidden {
  display: none !important;
}


/* ===============================
   AUTH / CARD / LOGO
================================ */

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-block {
  height: 420px;
  display: flex;
  flex-direction: column;
}

.auth-block .conter-block {
  margin-top: auto;
  margin-bottom: auto;
}

.logo {
  height: 36px;
  object-fit: contain;
}


/* ===============================
   DIVIDER (OpenAI style)
================================ */

.divider {
  position: relative;
  text-align: center;
}

.divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #e5e5e5;
}

.divider span {
  position: relative;
  background: #fff;
  padding: 0 12px;
  font-size: 12px;
  color: #6c757d;
  text-transform: uppercase;
}


/* ===============================
   BUTTONS
================================ */

.webkey-btn {
  font-weight: 500;
}

.home-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #dee2e6;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.home-btn:hover {
  background: #f8f9fa;
}

.home-btn .icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #212529;
  stroke-width: 1.8;
}


/* ===============================
   TELEGRAM AUDIO STYLE
================================ */

.tg-audio {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f1f3f5;
  border-radius: 16px;
  padding: 10px 14px;
}

.tg-wave {
  flex-grow: 1;
  height: 36px;
  display: flex;
  align-items: center;
}


/* ===============================
   PLAY BUTTON
================================ */

.tg-play {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #ffffff;
  color: #000000;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

.tg-play:hover {
  background: #f8f9fa;
}

/* overridden size/style */
.tg-play {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

.tg-play .icon {
  width: 16px;
  height: 16px;
  fill: #000000;
}


/* ===============================
   WAVESURFER FIX
================================ */

#waveform {
  width: 100%;
}

/* ===============================
  PDF
================================ */

#pdfCanvas {
  transition: transform 0.12s ease;
  display:block;
}

#pdfScroll {
  overflow-x: hidden;
}


.pdf-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
}

#pdfCanvas {
  transform-origin: center top;
  transition: transform 0.12s ease;
  display: block;
}

.pdf-preload {
  position: fixed;
  inset: 0;
  z-index: -1000;
  opacity: 0;
  pointer-events: none;
}

.pdf-visible {
  position: relative;
  inset: auto;
  z-index: 10;
  opacity: 1;
  pointer-events: auto;
}


/* ===============================
   Reader
================================ */

#reader {
  white-space: pre-wrap;
  word-break: break-word;
}

/* ===============================
   Video
================================ */

.video-wrap {
  position: relative;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
}

.video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-play {
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .2s, transform .2s;
  z-index: 2;
}

.video-play svg {
  width: 28px;
  height: 28px;
  fill: #000;
}

.video-play.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
}

.video-progress {
  height: 4px;
  background: #e9ecef;
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  z-index: 5; position: relative;
}

.video-progress-bar {
  height: 100%;
  width: 0%;
  background: #000;
  pointer-events: none; /* 👈 КЛЮЧЕВО */
}

.video-play, .video-fullscreen { pointer-events: auto; }

.video-progress {
  touch-action: manipulation;
}


.video-fullscreen {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  z-index: 3;
}

.video-fullscreen svg {
  width: 18px;
  height: 18px;
  fill: #000;
}

.fw-semibold {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.menu-margin-bottom {
  margin-bottom: 15px;
}

#date-nav {
  margin-bottom: 10px;
}

.fm-icon {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  vertical-align: -4px;
}

#pdfScroll {
  position: relative;
}

.pdf-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(2px);
}

.pdf-loader img {
  width: 48px;
  height: 48px;
  animation: pdf-spin 1s linear infinite;
}

@keyframes pdf-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.hidden {
  display: none !important;
}

.fm-loader {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(2px);

  display: flex;
  align-items: center;
  justify-content: center;
}

.fm-loader img {
  width: 48px;
  height: 48px;
  animation: pdf-spin 1s linear infinite;
}

.bg-white.rounded-4 {
  position: relative;
}



.stage-loader {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(2px);

  display: flex;
  align-items: center;
  justify-content: center;
}

.stage-loader img {
  width: 48px;
  height: 48px;
  animation: pdf-spin 1s linear infinite;
}

/* карточка должна быть позиционируемой */
.bg-white.rounded-4 {
  position: relative;
}
