/* ─────────────────────────────────────────────────────
   Photo Ratio Preview — Modal Styles v2
   Dark theme · sharp edges · single-ratio viewer
   ───────────────────────────────────────────────────── */

/* ── Overlay ─────────────────────────────────────────── */
.prp-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.prp-overlay.prp-open {
  opacity: 1;
  visibility: visible;
}

/* ── Modal container ─────────────────────────────────── */
.prp-modal {
  position: relative;
  width: 94vw;
  max-width: 820px;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  background: #151515;
  border: 1px solid #2a2a2a;
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.prp-overlay.prp-open .prp-modal {
  transform: scale(1);
}

/* ── Top bar ─────────────────────────────────────────── */
.prp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #2a2a2a;
  flex-shrink: 0;
}

.prp-title {
  font-size: 15px;
  font-weight: 600;
  color: #e0e0e0;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.prp-version {
  margin-left: 6px;
  color: #777;
  font-size: 12px;
  font-weight: 500;
}

.prp-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Orientation Segmented Selector ─────────────────── */
.prp-orient-selector {
  display: flex;
  background: #111111;
  border: 1px solid #2a2a2a;
  padding: 2px;
  border-radius: 0;
}

.prp-orient-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: #888;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  border-radius: 0;
}

.prp-orient-btn:hover {
  color: #fff;
}

.prp-orient-btn.prp-orient-active {
  background: #2a2a2a;
  color: #ffffff;
}

.prp-orient-btn svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.prp-orient-btn.prp-orient-active svg {
  opacity: 1;
}

/* ── Close X ─────────────────────────────────────────── */
.prp-close-x {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid #3a3a3a;
  background: #1e1e1e;
  color: #999;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.prp-close-x:hover {
  background: #333;
  color: #fff;
}

/* ── Sizes Selector Bar ─────────────────────────────── */
.prp-sizes-bar {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  background: #1a1a1a;
  border-bottom: 1px solid #2a2a2a;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
  flex-shrink: 0;
}

.prp-sizes-bar::-webkit-scrollbar {
  height: 4px;
}

.prp-sizes-bar::-webkit-scrollbar-track {
  background: transparent;
}

.prp-sizes-bar::-webkit-scrollbar-thumb {
  background: #333;
}

.prp-size-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  border: 1px solid #2a2a2a;
  background: #111;
  color: #aaa;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 0;
}

.prp-size-btn:hover {
  background: #222;
  color: #fff;
  border-color: #444;
}

.prp-size-btn.prp-size-active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  font-weight: 600;
}

/* ── Body (nav + stage) ──────────────────────────────── */
.prp-body {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-height: 0;
  padding: 20px 10px;
  gap: 8px;
}

/* ── Stage (centers viewport) ────────────────────────── */
.prp-stage {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

/* ── Viewport (aspect-ratio box) ─────────────────────── */
.prp-viewport {
  position: relative;
  width: 100%;
  max-width: calc(56vh * var(--aspect-ratio, 1));
  aspect-ratio: var(--aspect-ratio, 1);
  background: #0c0c0c;
  border: 1px solid #2a2a2a;
  overflow: hidden;
  cursor: default;
  margin: 0 auto;
}

/* Grab cursor when zoomed */
.prp-viewport:has(.prp-img[style*="scale"]) {
  cursor: grab;
}

.prp-viewport.prp-grabbing {
  cursor: grabbing;
}

/* ── Image ───────────────────────────────────────────── */
.prp-img {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  max-height: none;
  display: block;
  user-select: none;
  -webkit-user-select: none;
  transform-origin: center center;
  transition: none;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* ── Zoom controls ───────────────────────────────────── */
.prp-controls {
  padding: 8px 20px;
  border-top: 1px solid #1e1e1e;
  flex-shrink: 0;
}

.prp-zoom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.prp-zoom-icon {
  font-size: 16px;
  opacity: 0.6;
}

.prp-zoom-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 180px;
  height: 3px;
  background: #333;
  outline: none;
  cursor: pointer;
}

.prp-zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #888;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.prp-zoom-slider::-webkit-slider-thumb:hover {
  background: #bbb;
}

.prp-zoom-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #888;
  border: none;
  border-radius: 0;
  cursor: pointer;
}

.prp-zoom-label {
  font-size: 12px;
  color: #777;
  min-width: 40px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ── Info bar ────────────────────────────────────────── */
.prp-info-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 20px;
  border-top: 1px solid #1e1e1e;
  flex-shrink: 0;
}

.prp-counter {
  font-size: 12px;
  color: #555;
  font-variant-numeric: tabular-nums;
}

.prp-ratio-label {
  font-size: 14px;
  font-weight: 600;
  color: #ccc;
}

.prp-sizes-label {
  font-size: 12px;
  color: #666;
}

/* ── Footer ──────────────────────────────────────────── */
.prp-footer {
  display: flex;
  justify-content: center;
  padding: 14px 20px 18px;
  border-top: 1px solid #2a2a2a;
  flex-shrink: 0;
}

.prp-btn-close {
  padding: 10px 36px;
  border: 1px solid #3a3a3a;
  background: #1e1e1e;
  color: #ddd;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.prp-btn-close:hover {
  background: #2a2a2a;
  color: #fff;
  border-color: #555;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 600px) {
  .prp-modal {
    width: 100vw;
    max-height: 100vh;
    border: none;
  }

  .prp-body {
    padding: 12px 4px;
    gap: 4px;
  }

  .prp-viewport {
    max-width: calc(42vh * var(--aspect-ratio, 1));
  }

  .prp-topbar {
    padding: 12px 14px;
  }

  .prp-title {
    font-size: 13px;
  }

  .prp-version {
    display: none;
  }

  .prp-orient-text {
    display: none;
  }

  .prp-orient-btn {
    padding: 6px 10px;
    gap: 0;
  }

  .prp-info-bar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .prp-zoom-slider {
    width: 120px;
  }
}
