/**
 * ONE RESIZER — Tool 13: PDF to Text Stylesheet
 * Native PDF Text Extraction, Paragraph Reconstruction, Character & Word Counters,
 * Live Preview, Clipboard Copy, and Responsive Studio Layout.
 */

/* ========================================================
   CONTAINER & WORKSPACE VIEWS
   ======================================================== */
.pdftt-container {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.pdftt-view {
  display: block;
  width: 100%;
  box-sizing: border-box;
}
.pdftt-view.hidden {
  display: none !important;
}

/* ========================================================
   UPLOAD HERO SCREEN
   ======================================================== */
.upload-hero-card {
  background: var(--bg-card);
  border: 2px dashed var(--primary-cyan);
  border-radius: var(--radius-xl);
  padding: 48px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}
.upload-hero-card:hover, .upload-hero-card.dragover {
  background: rgba(22, 135, 245, 0.08);
  border-color: var(--primary-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.upload-icon-wrapper {
  width: 68px;
  height: 68px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: rgba(22, 135, 245, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-cyan);
}
.upload-icon-wrapper svg {
  width: 36px;
  height: 36px;
  stroke: currentColor;
  fill: none;
}

.upload-heading {
  font-size: 20px;
  font-weight: 850;
  color: var(--text-heading);
  margin-bottom: 6px;
}
.upload-subheading {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.upload-btn-fake {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-cyan);
  color: #fff;
  font-weight: 800;
  font-size: 13.5px;
  padding: 9px 22px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 14px var(--primary-glow);
  margin-bottom: 14px;
  transition: var(--transition);
}
.upload-btn-fake:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--primary-glow);
}
.upload-formats-badge {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  padding: 5px 14px;
  border-radius: var(--radius-full);
}

/* ========================================================
   WORKSPACE 2-COLUMN STUDIO LAYOUT
   ======================================================== */
.pdftt-studio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .pdftt-studio-grid {
    grid-template-columns: 1fr;
  }
}

/* Left Column: Config Panel & Preview */
.pdftt-panel-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

/* File Bar */
.pdftt-file-mini-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  margin-bottom: 18px;
}
.pdftt-mini-info {
  min-width: 0;
}
.pdftt-mini-name {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.pdftt-mini-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 1px;
}
.pdftt-btn-change {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 750;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.pdftt-btn-change:hover {
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
}

/* Mode Selection Tabs (All Pages vs Range) */
.pdftt-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 4px;
  margin-bottom: 16px;
}
.pdftt-mode-tab {
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}
.pdftt-mode-tab:hover {
  color: var(--text-heading);
}
.pdftt-mode-tab.active {
  background: var(--bg-card);
  color: var(--primary-cyan);
  box-shadow: var(--shadow-sm);
}

/* Range Input Wrap */
.pdftt-range-wrap {
  margin-bottom: 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
}
.pdftt-range-input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-heading);
  outline: none;
  box-sizing: border-box;
}
.pdftt-range-input:focus {
  border-color: var(--primary-cyan);
}
.pdftt-range-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Document Page Preview Box */
.pdftt-preview-box {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 18px;
}
.pdftt-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.pdftt-preview-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-heading);
}
.pdftt-preview-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pdftt-nav-btn {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--text-heading);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: var(--transition);
}
.pdftt-nav-btn:hover:not(:disabled) {
  background: var(--primary-cyan);
  color: #fff;
}
.pdftt-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.pdftt-nav-counter {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-muted);
}

.pdftt-canvas-wrap {
  width: 100%;
  height: 240px;
  background: #fff;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--line);
}
.pdftt-canvas-wrap canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Action Button */
.pdftt-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 22px;
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
  color: #fff;
  font-size: 16px;
  font-weight: 850;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  box-shadow: 0 4px 16px var(--primary-glow);
  transition: var(--transition);
}
.pdftt-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px var(--primary-glow);
}
.pdftt-action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Progress Bar */
.pdftt-progress-card {
  margin-top: 16px;
  padding: 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: none;
}
.pdftt-progress-card.active {
  display: block;
}
.pdftt-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 6px;
}
.pdftt-progress-track {
  width: 100%;
  height: 8px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.pdftt-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary-cyan), #10b981);
  transition: width 0.2s ease;
}

/* Right Column: Extracted Text Area & Results */
.pdftt-result-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

.pdftt-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.pdftt-result-title {
  font-size: 15px;
  font-weight: 850;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 6px;
}
.pdftt-stats-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pdftt-badge-stat {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--primary-cyan);
}

/* Large Textarea */
.pdftt-textarea {
  width: 100%;
  height: 380px;
  padding: 14px;
  background: var(--bg-subtle);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-heading);
  resize: vertical;
  outline: none;
  box-sizing: border-box;
  margin-bottom: 16px;
  transition: var(--transition);
}
.pdftt-textarea:focus {
  border-color: var(--primary-cyan);
  box-shadow: 0 0 0 3px rgba(22, 135, 245, 0.15);
}

/* Scanned Warning Banner */
.pdftt-warning-banner {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #b45309;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 12.5px;
  font-weight: 750;
  margin-bottom: 14px;
  display: none;
}

/* Action Buttons Row */
.pdftt-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.pdftt-btn-copy {
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1.5px solid var(--primary-cyan);
  color: var(--primary-cyan);
  font-size: 13.5px;
  font-weight: 800;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.pdftt-btn-copy:hover {
  background: var(--primary-cyan);
  color: #fff;
}

.pdftt-btn-download {
  padding: 12px 16px;
  background: #10b981;
  border: none;
  color: #fff;
  font-size: 13.5px;
  font-weight: 850;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}
.pdftt-btn-download:hover {
  background: #059669;
  transform: translateY(-1px);
}

.pdftt-btn-reset-full {
  width: 100%;
  padding: 9px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
}
.pdftt-btn-reset-full:hover {
  color: var(--text-heading);
  border-color: var(--primary-cyan);
}
