/* ═══════════════════════════════════════════════
   Images to PDF — Tool Styles
   ═══════════════════════════════════════════════ */

/* ── Page Body ──────────────────────────────────── */
.itp-page-body {
  display: block;
}

/* ── Drop Zone ──────────────────────────────────── */
.itp-drop-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  border-bottom: 1px solid var(--border);
  background: #050505;
  cursor: pointer;
  position: relative;
  transition: background 0.18s;
  outline: none;
}

.itp-drop-zone:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: -2px;
}

.itp-drop-zone.dragover {
  background: #0e0e0e;
  border-color: var(--yellow) !important;
}

.itp-drop-zone.dragover .itp-dz-icon {
  color: var(--yellow);
  transform: scale(1.08);
}

.itp-dz-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 32px;
  text-align: center;
  pointer-events: none;
}

.itp-dz-icon {
  color: var(--border);
  transition: color 0.2s, transform 0.2s;
  margin-bottom: 6px;
}

.itp-dz-title {
  font-family: var(--cond);
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--white);
  margin: 0;
}

.itp-dz-hint {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin: 0;
}

.itp-dz-browse {
  margin-top: 10px;
  height: 40px;
  padding: 0 28px;
  background: var(--yellow);
  color: var(--ink, #0c0c0c);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  pointer-events: all;
  transition: background 0.15s, transform 0.12s;
}

.itp-dz-browse:hover {
  background: #d4e600;
}

.itp-dz-browse:active {
  transform: translateY(1px);
}

/* ── Preview Wrap ────────────────────────────────── */
.itp-preview-wrap {
  border-bottom: 1px solid var(--border);
  background: #060606;
}

.itp-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 46px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: #0a0a0a;
}

.itp-preview-toolbar-left,
.itp-preview-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0;
}

.itp-file-count {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  padding-right: 16px;
  border-right: 1px solid var(--border);
  margin-right: 0;
}

.itp-toolbar-btn {
  height: 46px;
  padding: 0 18px;
  border: none;
  border-left: 1px solid var(--border);
  background: none;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}

.itp-toolbar-btn:hover {
  color: var(--white);
  background: #111;
}

.itp-toolbar-btn.danger:hover {
  color: #ff5252;
  background: rgba(255, 82, 82, 0.06);
}

/* ── Image Grid ──────────────────────────────────── */
.itp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0;
  padding: 20px;
  gap: 12px;
}

.itp-card {
  position: relative;
  border: 1px solid var(--border);
  background: #0a0a0a;
  overflow: hidden;
  cursor: grab;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  user-select: none;
}

.itp-card:hover {
  border-color: var(--yellow);
  box-shadow: 0 0 0 1px var(--yellow);
}

.itp-card.dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.itp-card.drag-over {
  border-color: var(--yellow);
  background: #111;
  transform: scale(1.02);
}

.itp-card-thumb {
  width: 100%;
  aspect-ratio: 1 / 1.2;
  object-fit: cover;
  display: block;
  background: #0e0e0e;
}

.itp-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: #0a0a0a;
  border-top: 1px solid var(--border);
}

.itp-card-name {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

.itp-card-page {
  font-family: var(--mono);
  font-size: 0.58rem;
  color: var(--yellow);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.itp-card-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  background: rgba(0,0,0,0.75);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
  border-radius: 2px;
}

.itp-card-remove:hover {
  color: #ff5252;
  border-color: #ff5252;
  background: rgba(255, 82, 82, 0.15);
}

/* Drag handle indicator */
.itp-card::before {
  content: '⋮⋮';
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 0.9rem;
  letter-spacing: -1px;
  color: rgba(255,255,255,0.2);
  line-height: 1;
  pointer-events: none;
}

/* ── Options Bar ─────────────────────────────────── */
.itp-options-bar {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  background: #0a0a0a;
}

.itp-opt-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 12px 20px;
  border-right: 1px solid var(--border);
  flex: 1;
  min-width: 120px;
}

.itp-opt-group.itp-opt-quality {
  flex: 2;
  min-width: 180px;
}

.itp-opt-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.itp-opt-select {
  background: #111;
  border: 1px solid var(--border);
  color: var(--white);
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 5px 10px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.12s;
}

.itp-opt-select:focus {
  border-color: var(--yellow);
}

/* Range slider */
.itp-range-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.itp-range {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}

.itp-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--yellow);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  transition: transform 0.12s;
}

.itp-range::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.itp-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--yellow);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.itp-range-val {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--yellow);
  min-width: 34px;
  text-align: right;
}

/* ── Action Bar ──────────────────────────────────── */
.itp-action-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: #050505;
}

.itp-btn-convert {
  height: 48px;
  padding: 0 36px;
  background: var(--yellow);
  color: var(--ink, #0c0c0c);
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.15s, transform 0.12s, opacity 0.15s;
  flex-shrink: 0;
}

.itp-btn-convert:hover:not(:disabled) {
  background: #d4e600;
}

.itp-btn-convert:active:not(:disabled) {
  transform: translateY(1px);
}

.itp-btn-convert:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.itp-btn-icon {
  display: flex;
  align-items: center;
}

/* Progress bar */
.itp-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.itp-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  overflow: hidden;
}

.itp-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--yellow);
  transition: width 0.25s ease;
}

.itp-progress-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

/* ── Docs Layout ─────────────────────────────────── */
.itp-docs-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
}

@media (max-width: 900px) {
  .itp-docs-layout {
    grid-template-columns: 1fr;
  }
}

.itp-docs-layout > main {
  border-right: 1px solid var(--border);
}

.itp-docs-side {
  display: flex;
  flex-direction: column;
  background: #080808;
}

/* bento-cs-header extension for this tool */
.bento-cs-header {
  display: flex;
  align-items: center;
  padding: 0 28px;
  height: 46px;
  border-bottom: 1px solid var(--border);
  background: #0a0a0a;
  margin-bottom: 0;
}

.bento-cs-header-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bento-cs-header-title {
  font-family: var(--cond);
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--white);
  margin-left: 16px;
  border-left: 1px solid var(--border);
  padding-left: 16px;
}

/* Override bento-step for this doc section */
.itp-docs-layout .bento-content-section {
  padding: 0;
}

.itp-docs-layout .bento-step {
  display: grid;
  grid-template-columns: 48px 1fr;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  margin-bottom: 0;
  padding: 0;
  background: #050505;
  transition: background 0.12s;
}

.itp-docs-layout .bento-step:hover {
  background: #0d0d0d;
  border-left-color: var(--yellow);
}

.itp-docs-layout .bento-step-num {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 22px 0 20px;
  border-right: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--yellow);
  letter-spacing: 0.04em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  line-height: 1;
}

.itp-docs-layout .bento-step-content {
  padding: 20px 24px;
}

.itp-docs-layout .bento-step-title {
  font-family: var(--cond);
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--white);
  margin-bottom: 6px;
}

.itp-docs-layout .bento-step-desc {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
  .itp-options-bar {
    flex-direction: column;
  }

  .itp-opt-group {
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .itp-opt-group.itp-opt-quality {
    min-width: unset;
  }

  .itp-opt-label {
    min-width: 96px;
    flex-shrink: 0;
  }

  .itp-action-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .itp-progress-wrap {
    width: 100%;
  }

  .itp-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    padding: 12px;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .itp-dz-inner {
    padding: 32px 20px;
  }

  .itp-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
