/*
 * ╔══════════════════════════════════════════════════════════╗
 * ║  DamaPrompto — css/app.css                               ║
 * ║  Styles du lecteur de documents pour lunettes            ║
 * ╚══════════════════════════════════════════════════════════╝
 */

/* ── Écran principal : liste des documents ─────────────── */
#content-main {
  padding: 0;
  gap: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
  overflow: hidden;
}

.prompto-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  min-height: 32px;
  flex-shrink: 0;
  background: var(--bg);
  z-index: 2;
}

.prompto-path {
  font-size: 13px;
  color: var(--cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.prompto-sort {
  font-size: 12px;
  color: var(--white);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.prompto-sort:focus {
  color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
  outline: none;
}

/* ── Zone de scroll ─────────────────────────────────────── */
.scroll-wrap {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.prompto-doc-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.prompto-doc-list::-webkit-scrollbar {
  width: 3px;
}
.prompto-doc-list::-webkit-scrollbar-track {
  background: var(--bg2);
}
.prompto-doc-list::-webkit-scrollbar-thumb {
  background: var(--cyan);
  border-radius: 2px;
}

.prompto-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--white);
  font-size: 14px;
}

/* ── Item de la liste ──────────────────────────────────── */
.prompto-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 4px;
  margin: 1px 6px;
  transition: all 120ms ease;
  min-height: 30px;
}

.prompto-item:focus {
  background: rgba(0, 212, 255, 0.06);
  border-color: var(--cyan);
  outline: none;
  box-shadow: var(--glow-cyan);
}

.prompto-item-name {
  flex: 1;
  font-size: 13px;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prompto-item-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 11px;
  color: var(--cyan);
  white-space: nowrap;
}

.prompto-item-size {
  color: var(--cyan);
  font-size: 10px;
}

/* ── Badges type ───────────────────────────────────────── */
.prompto-badge {
  display: inline-block;
  min-width: 32px;
  text-align: center;
  font-size: 10px;
  font-weight: bold;
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
.prompto-badge-pdf  { background: rgba(200, 50, 50, 0.4); }
.prompto-badge-txt  { background: rgba(100, 150, 200, 0.3); }
.prompto-badge-html { background: rgba(50, 180, 100, 0.3); }
.prompto-badge-img  { background: rgba(200, 150, 50, 0.3); }
.prompto-badge-dir  { background: rgba(0, 212, 255, 0.15); font-size: 14px; min-width: 36px; }
.prompto-badge-back { background: rgba(0, 212, 255, 0.15); font-size: 14px; min-width: 36px; }

/* ── Footer hints ──────────────────────────────────────── */
.prompto-list-footer,
.prompto-reader-bottom {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 6px 8px;
  border-top: 1px solid var(--border);
  min-height: 28px;
  flex-shrink: 0;
  background: var(--bg);
  z-index: 2;
}

.prompto-hint {
  font-size: 13px;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 4px;
}

.prompto-arrow {
  color: var(--cyan);
  font-weight: bold;
  font-size: 15px;
}

/* ══════════════════════════════════════════════════════════
   LECTEUR TEXTE
══════════════════════════════════════════════════════════ */
#content-text {
  padding: 0;
  gap: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
}

.prompto-reader-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  min-height: 32px;
  flex-shrink: 0;
  background: var(--bg);
  z-index: 2;
}

.prompto-reader-title {
  font-size: 14px;
  color: var(--cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.prompto-reader-page {
  font-size: 13px;
  color: var(--white);
  white-space: nowrap;
  margin-left: 10px;
}

.prompto-reader-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 10px 14px;
  position: relative;
  cursor: pointer;
  border: 2px solid transparent;
}
.prompto-reader-body:focus {
  border-color: var(--cyan);
  outline: none;
  box-shadow: var(--glow-cyan);
}

.prompto-reader-progress {
  height: 3px;
  background: var(--border);
  flex-shrink: 0;
}
.prompto-reader-progress > div {
  height: 100%;
  background: var(--cyan);
  transition: width 200ms ease;
  width: 0;
}

/* ── Contenu texte ─────────────────────────────────────── */
#prompto-text-inner {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.35;
  color: var(--white);
  white-space: pre-wrap;
  word-break: break-word;
}

#prompto-text-inner.prompto-zoom-1 {
  font-size: 19px;
  line-height: 1.3;
}

#prompto-text-inner.prompto-zoom-2 {
  font-size: 24px;
  line-height: 1.25;
}

.prompto-line {
  min-height: 1.3em;
  padding: 2px 0;
}

.prompto-title-line {
  color: var(--cyan);
  font-weight: bold;
}

.prompto-spacer {
  height: 0.6em;
}

/* ── Flash overlay (étoiles) ───────────────────────────── */
.prompto-flash-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.prompto-flash-overlay.active {
  opacity: 1;
}
.prompto-flash-overlay canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ══════════════════════════════════════════════════════════
   VISIONNEUSE IMAGE
══════════════════════════════════════════════════════════ */
#content-image {
  padding: 0;
  gap: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
}

.prompto-img-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 2px solid transparent;
  cursor: pointer;
  min-height: 0;
}
.prompto-img-body:focus {
  border-color: var(--cyan);
  outline: none;
  box-shadow: var(--glow-cyan);
}

#prompto-img-view {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
  transition: transform 200ms ease;
}
/* ── Boutons bottomnav (D-pad) ─────────────────────────── */
#btn-nav-enter,
#btn-nav-left,
#btn-nav-right,
#btn-nav-up,
#btn-nav-down {
  min-width: 80px;
}
