/* ==========================================================================
   FileToolKit - Tool View & Workspace Styles
   ========================================================================== */

.tool-page-header {
  padding-top: var(--space-8);
  padding-bottom: var(--space-6);
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.tool-header-badge-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.tool-page-title {
  font-size: clamp(2rem, 3.5vw + 1rem, 2.75rem);
  font-weight: var(--font-weight-extrabold);
  margin-bottom: var(--space-3);
}

.tool-page-desc {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-6);
}

/* Tool Workbench Area */
.tool-workbench {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-12);
  overflow: hidden;
  position: relative;
}

.workbench-body {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 992px) {
  .workbench-body {
    grid-template-columns: 1.25fr 1fr;
  }
}

.workbench-preview-pane {
  background-color: var(--bg-muted);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  position: relative;
  overflow: hidden;
}

@media (min-width: 992px) {
  .workbench-preview-pane {
    border-bottom: none;
    border-right: 1px solid var(--border-color);
  }
}

.workbench-options-pane {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  background-color: var(--bg-card);
}

/* Control Groups */
.control-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.control-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.control-label-value {
  color: var(--emerald-primary);
  font-family: var(--font-mono);
}

.range-slider-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.range-slider {
  flex-grow: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--emerald-primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(22, 163, 106, 0.4);
  transition: transform var(--transition-fast);
}

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

/* Preset Buttons Grid */
.preset-button-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
}

.preset-btn {
  padding: 0.6rem 0.75rem;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}

.preset-btn:hover {
  border-color: var(--emerald-border);
  color: var(--text-primary);
}

.preset-btn.active {
  background-color: var(--emerald-tint);
  border-color: var(--emerald-primary);
  color: var(--emerald-dark);
  font-weight: var(--font-weight-semibold);
}

/* Target File Size Input Box */
.target-size-box {
  display: flex;
  gap: var(--space-2);
}

.target-size-input {
  flex-grow: 1;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  background-color: var(--bg-card);
  color: var(--text-primary);
}

.target-size-unit {
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-muted);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

/* Processing State Animation */
.processing-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
}

[data-theme="dark"] .processing-overlay {
  background-color: rgba(16, 24, 20, 0.92);
}

.processing-spinner {
  width: 54px;
  height: 54px;
  border: 4px solid var(--emerald-tint);
  border-top-color: var(--emerald-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.processing-message {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

/* Output / Result Card */
.result-card {
  padding: var(--space-6);
  background-color: var(--bg-card);
  border: 1px solid var(--emerald-border);
  border-radius: var(--radius-xl);
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
}

.result-badge-success {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--emerald-primary) 0%, var(--emerald-hover) 100%);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  box-shadow: var(--shadow-emerald);
}

.result-stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  padding: var(--space-3) var(--space-6);
  background-color: var(--bg-muted);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
}

.result-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.result-stat-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.result-stat-value {
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.result-savings-badge {
  color: var(--emerald-primary);
  font-weight: var(--font-weight-extrabold);
}

/* PDF Thumbnail Grid (PDF Workspace) */
.pdf-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-3);
  width: 100%;
  max-height: 450px;
  overflow-y: auto;
  padding: var(--space-2);
}

.pdf-page-card {
  position: relative;
  background: #FFFFFF;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: grab;
  transition: all var(--transition-fast);
}

.pdf-page-card:hover {
  border-color: var(--emerald-primary);
  box-shadow: var(--shadow-sm);
}

.pdf-page-card.selected {
  border-color: var(--emerald-primary);
  background-color: var(--emerald-tint);
}

.pdf-page-canvas {
  width: 100%;
  height: auto;
  max-height: 140px;
  object-fit: contain;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pdf-page-number {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  margin-top: var(--space-1);
  color: var(--text-secondary);
}

.pdf-page-actions {
  display: flex;
  gap: var(--space-1);
  margin-top: var(--space-1);
}

.pdf-page-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  padding: 2px 4px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 10px;
}

.pdf-page-btn:hover {
  color: var(--emerald-primary);
  border-color: var(--emerald-border);
}

/* Educational & FAQ Content */
.tool-content-section {
  padding-top: var(--space-8);
  padding-bottom: var(--space-12);
  border-top: 1px solid var(--border-color);
}

.tool-steps-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-6);
  margin-bottom: var(--space-10);
}

@media (min-width: 768px) {
  .tool-steps-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.tool-step-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.tool-step-num {
  width: 32px;
  height: 32px;
  background-color: var(--emerald-tint);
  color: var(--emerald-dark);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-2);
}
