/**
 * ONE RESIZER — Tool 07: PDF Compressor Stylesheet
 * Exact Target-Size PDF Compression Engine UI
 * Mobile-First, Light/Dark theme compatible, clean SaaS layout.
 */

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

.pdfc-view {
  display: block;
  width: 100%;
  box-sizing: border-box;
}
.pdfc-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);
}

/* ========================================================
   TOP FILE METADATA BAR
   ======================================================== */
.pdfc-file-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.pdfc-file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.pdfc-file-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
  flex-shrink: 0;
}
.pdfc-file-meta {
  min-width: 0;
}
.pdfc-file-name {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}
.pdfc-file-stats {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.pdfc-file-badge {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  padding: 1px 7px;
  border-radius: 4px;
  font-weight: 750;
  color: var(--text-heading);
}

.pdfc-change-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 750;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}
.pdfc-change-btn:hover {
  background: rgba(22, 135, 245, 0.1);
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
}

/* ========================================================
   WORKSPACE GRID (CONTROLS & PREVIEW)
   ======================================================== */
.pdfc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}
@media (max-width: 900px) {
  .pdfc-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================================
   TARGET FILE SIZE CONTROL CARD
   ======================================================== */
.pdfc-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.pdfc-card-header {
  margin-bottom: 18px;
}
.pdfc-card-title {
  font-size: 17px;
  font-weight: 850;
  color: var(--text-heading);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pdfc-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Target Input Box */
.pdfc-target-container {
  background: var(--bg-subtle);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 16px;
  transition: var(--transition);
}
.pdfc-target-container:focus-within {
  border-color: var(--primary-cyan);
  box-shadow: 0 0 0 3px rgba(22, 135, 245, 0.15);
}

.pdfc-target-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 10px;
  display: block;
}

.pdfc-target-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pdfc-target-input {
  flex: 1;
  font-size: 22px;
  font-weight: 900;
  color: var(--text-heading);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  outline: none;
  min-width: 0;
  transition: var(--transition);
}
.pdfc-target-input:focus {
  border-color: var(--primary-cyan);
}

.pdfc-target-unit {
  font-size: 15px;
  font-weight: 850;
  color: var(--text-heading);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}
.pdfc-target-unit:focus {
  border-color: var(--primary-cyan);
}

/* Quick Target Chips */
.pdfc-chips-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
}
.pdfc-chips-title {
  font-size: 11.5px;
  font-weight: 750;
  color: var(--text-muted);
  margin-right: 2px;
}
.pdfc-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  color: var(--text-heading);
  font-size: 12px;
  font-weight: 750;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}
.pdfc-chip:hover {
  background: rgba(22, 135, 245, 0.1);
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
}
.pdfc-chip.active {
  background: var(--primary-cyan);
  border-color: var(--primary-cyan);
  color: #fff;
}

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

/* ========================================================
   PROGRESS CARD
   ======================================================== */
.pdfc-progress-card {
  margin-top: 18px;
  padding: 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: none;
}
.pdfc-progress-card.active {
  display: block;
}

.pdfc-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 8px;
}
.pdfc-progress-track {
  width: 100%;
  height: 10px;
  background: var(--line);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.pdfc-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary-cyan), #10b981);
  border-radius: 6px;
  transition: width 0.2s ease;
}

/* ========================================================
   RESULTS CARD (COMPLETED COMPRESSION)
   ======================================================== */
.pdfc-results-card {
  margin-top: 20px;
  padding: 20px;
  border: 2px solid #10b981;
  background: rgba(16, 185, 129, 0.06);
  border-radius: var(--radius-xl);
  display: none;
}
.pdfc-results-card.active {
  display: block;
  animation: fadeIn 0.3s ease;
}
.pdfc-results-card.warning {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.06);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.pdfc-results-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 900;
  color: #10b981;
  margin-bottom: 14px;
}
.pdfc-results-card.warning .pdfc-results-header {
  color: #f59e0b;
}

.pdfc-warning-banner {
  display: none;
  font-size: 12.5px;
  color: var(--text-heading);
  background: rgba(245, 158, 11, 0.12);
  border-left: 3px solid #f59e0b;
  padding: 8px 12px;
  border-radius: 4px;
  margin-bottom: 14px;
  line-height: 1.4;
}

.pdfc-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
@media (max-width: 500px) {
  .pdfc-metrics-grid {
    grid-template-columns: 1fr;
  }
}

.pdfc-metric-box {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  text-align: center;
}
.pdfc-metric-label {
  font-size: 11px;
  font-weight: 750;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}
.pdfc-metric-value {
  font-size: 16px;
  font-weight: 900;
  color: var(--text-heading);
}
.pdfc-metric-saved {
  color: #10b981;
}

.pdfc-download-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  background: #10b981;
  color: #fff;
  font-size: 15px;
  font-weight: 850;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
  transition: var(--transition);
  margin-bottom: 10px;
}
.pdfc-download-btn:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.pdfc-secondary-actions {
  display: flex;
  gap: 10px;
}
.pdfc-btn-secondary {
  flex: 1;
  padding: 9px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--text-heading);
  font-size: 12.5px;
  font-weight: 750;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
}
.pdfc-btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
}

/* ========================================================
   PREVIEW PANEL
   ======================================================== */
.pdfc-preview-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.pdfc-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.pdfc-preview-status-badge {
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  color: var(--text-muted);
}
.pdfc-preview-status-badge.compressed {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  color: #10b981;
}

.pdfc-page-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pdfc-nav-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  color: var(--text-heading);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}
.pdfc-nav-btn:hover:not(:disabled) {
  background: var(--primary-cyan);
  color: #fff;
  border-color: var(--primary-cyan);
}
.pdfc-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pdfc-page-counter {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-heading);
  min-width: 75px;
  text-align: center;
}

.pdfc-canvas-wrap {
  width: 100%;
  min-height: 380px;
  max-height: 520px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 16px;
  box-sizing: border-box;
}

.pdfc-canvas-wrap canvas {
  max-width: 100%;
  max-height: 480px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  border-radius: 4px;
  background: #fff;
}

/* Page Thumbnails Strip */
.pdfc-thumbs-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 12px 4px 4px;
  margin-top: 12px;
}
.pdfc-thumb-item {
  flex-shrink: 0;
  width: 60px;
  text-align: center;
  cursor: pointer;
}
.pdfc-thumb-preview {
  width: 60px;
  height: 78px;
  background: var(--bg-subtle);
  border: 2px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  transition: var(--transition);
}
.pdfc-thumb-item.active .pdfc-thumb-preview {
  border-color: var(--primary-cyan);
  box-shadow: 0 0 0 2px rgba(22, 135, 245, 0.2);
}
.pdfc-thumb-preview canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.pdfc-thumb-number {
  font-size: 11px;
  font-weight: 750;
  color: var(--text-muted);
}
