/* ═══════════════════════════════════════════════════════════
   A.L. Forniture - PDF Flipbook CSS
═══════════════════════════════════════════════════════════ */

#alf .alf-flip-host {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(150deg, #2a2a2a 0%, #1a1a1a 100%);
  overflow: hidden;
}

/* loader iniziale */
#alf .alf-flip-loader {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: rgba(255,255,255,.7);
}
#alf .alf-flip-spinner {
  width: 38px; height: 38px;
  border: 3px solid rgba(255,255,255,.12);
  border-top-color: rgba(255,255,255,.7);
  border-radius: 50%;
  animation: alfFlipSpin 1s linear infinite;
}
@keyframes alfFlipSpin { to { transform: rotate(360deg); } }
#alf .alf-flip-loader-txt { font-size: 13.5px; font-weight: 500; }
#alf .alf-flip-loader-prog {
  font-family: var(--alf-mono);
  font-size: 12px;
  color: rgba(255,255,255,.5);
  background: rgba(255,255,255,.06);
  padding: 4px 12px;
  border-radius: 12px;
  min-width: 70px;
  text-align: center;
}

/* error */
#alf .alf-flip-error {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; padding: 30px; text-align: center;
}
#alf .alf-flip-error-ic { font-size: 42px; }
#alf .alf-flip-error-title { color: #fff; font-size: 15px; font-weight: 700; }
#alf .alf-flip-error-sub { color: rgba(255,255,255,.5); font-size: 12px; max-width: 320px; line-height: 1.5; }
#alf .alf-flip-error-btn {
  background: var(--alf-blue); color: #fff;
  padding: 10px 20px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  text-decoration: none;
  transition: opacity .15s;
}
#alf .alf-flip-error-btn:hover { opacity: .85; color: #fff; }

/* wrap */
#alf .alf-flip-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* toolbar */
#alf .alf-flip-tb {
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  z-index: 10;
}
#alf .alf-flip-btn {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.85);
  width: 32px; height: 32px;
  border-radius: 7px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
  font-family: inherit;
}
#alf .alf-flip-btn:hover {
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.22);
  color: #fff;
}
#alf .alf-flip-btn:active { transform: scale(.95); }

#alf .alf-flip-pager {
  font-family: var(--alf-mono);
  font-size: 12px;
  color: rgba(255,255,255,.65);
  background: rgba(255,255,255,.05);
  padding: 6px 12px;
  border-radius: 6px;
  min-width: 80px;
  text-align: center;
}
#alf .alf-flip-pager span { color: #fff; font-weight: 600; }

#alf .alf-flip-sp { flex: 1; }

/* book area */
#alf .alf-flip-book {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  min-height: 0;
  overflow: hidden;
}

#alf .alf-flip-page {
  background: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
#alf .alf-flip-page img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
#alf .alf-flip-page-err {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: #f5f5f5; color: #999;
  font-size: 13px; text-align: center;
}

/* fullscreen mode */
#alf-frame-wrap:fullscreen {
  background: #1a1a1a;
}
#alf-frame-wrap:fullscreen .alf-flip-host {
  border-radius: 0;
}

/* mobile adjustments */
@media (max-width: 540px) {
  #alf .alf-flip-tb {
    padding: 6px 8px;
    gap: 5px;
  }
  #alf .alf-flip-btn {
    width: 30px; height: 30px;
    font-size: 16px;
  }
  #alf .alf-flip-pager {
    font-size: 11px;
    padding: 5px 9px;
    min-width: 60px;
  }
  #alf .alf-flip-book {
    padding: 8px;
  }
}
