/* ==========================================================================
   PulseShifa (نبضِ شفا) - Elite Protocol Reader Viewport Styles
   ========================================================================== */

:root {
  --reader-header-h: 68px;
  --reader-sidebar-w: 360px;
}

body.reader-mode {
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
}

/* Scroll Progress Bar */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--crimson));
  width: 0%;
  z-index: 999;
  transition: width 0.1s ease-out;
}

/* Reader Top Header */
.reader-top-bar {
  height: var(--reader-header-h);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--outline-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 100;
}

.reader-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.reader-protocol-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 480px;
}

.reader-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Reader Layout Body */
.reader-workspace {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* Iframe Host Container */
.reader-frame-container {
  flex: 1;
  height: 100%;
  background: var(--bg-main);
  position: relative;
  overflow: hidden;
}

.protocol-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Sidebar Drawer */
.reader-sidebar {
  width: var(--reader-sidebar-w);
  height: 100%;
  background: var(--surface-card);
  border-left: 1px solid var(--outline-card);
  overflow-y: auto;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  transition: transform var(--duration-norm) var(--ease-spring);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.25);
  z-index: 90;
}

.reader-sidebar.is-collapsed {
  transform: translateX(100%);
  position: absolute;
  right: 0;
  top: 0;
}

.sidebar-metric-box {
  background: var(--surface-low);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--outline-subtle);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.highlight-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--on-surface-muted);
  line-height: 1.8;
}

.highlight-item i {
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 5px;
}

@media (max-width: 900px) {
  .reader-sidebar {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 150;
    box-shadow: -12px 0 35px rgba(0, 0, 0, 0.6);
  }
  .reader-protocol-title {
    max-width: 220px;
  }
}
