/* ===== Tool Page — KukuPDF ===== */
.tool-page { padding: var(--space-2xl) 0 var(--space-3xl); }
.tool-page-inner { max-width: var(--container-narrow); margin: 0 auto; padding: 0 var(--space-lg); }

/* Breadcrumb */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  color: var(--text-muted); margin-bottom: var(--space-lg); flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-secondary); transition: color var(--transition-fast); }
.breadcrumb a:hover { color: var(--primary-light); }
.breadcrumb-sep { width: 14px; height: 14px; color: var(--primary); }
.breadcrumb-current { color: var(--text-main); font-weight: 500; }

/* Tool Header */
.tool-header { text-align: center; margin-bottom: var(--space-xl); }
.tool-header-icon {
  width: 72px; height: 72px; border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--space-md);
}
.tool-header-icon i { width: 36px; height: 36px; color: white; }
.tool-header h1 { font-size: var(--fs-3xl); margin-bottom: var(--space-sm); letter-spacing: -0.02em; }
.tool-header p { font-size: var(--fs-md); color: var(--text-secondary); max-width: 480px; margin: 0 auto; }
.tool-header .badge { margin-left: 8px; vertical-align: middle; }

/* Upload Zone */
.upload-zone {
  border: 2px dashed rgba(123, 47, 255, 0.35);
  border-radius: var(--radius-xl); padding: var(--space-2xl) var(--space-lg);
  text-align: center; transition: all var(--transition-base);
  background: rgba(22, 15, 46, 0.5); position: relative; cursor: pointer;
  min-height: 220px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--space-md);
}
.upload-zone:hover {
  border-color: var(--primary-light);
  background: rgba(123, 47, 255, 0.08);
}
.upload-zone.drag-active {
  border-color: var(--primary); background: rgba(123, 47, 255, 0.08);
  box-shadow: inset 0 0 40px rgba(123, 47, 255, 0.15);
  animation: marchingAnts 1s linear infinite;
}
@keyframes marchingAnts {
  to { background-position: 100% 100%; }
}
.upload-zone-icon { width: 56px; height: 56px; color: var(--primary); opacity: 0.7; }
.upload-zone-text { display: flex; flex-direction: column; align-items: center; gap: var(--space-sm); }
.upload-zone-text .btn {
  background: rgba(123, 47, 255, 0.15);
  border: 1px solid rgba(123, 47, 255, 0.5);
  color: var(--primary-light); box-shadow: none;
}
.upload-zone-text .btn:hover {
  background: rgba(123, 47, 255, 0.3);
  border-color: var(--primary);
}
.upload-zone-hint { font-size: var(--fs-sm); color: var(--text-muted); }
.upload-zone-cloud { display: flex; align-items: center; gap: var(--space-md); margin-top: var(--space-sm); }
.cloud-btn {
  padding: 6px 12px; border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm);
  color: var(--text-secondary); transition: all var(--transition-fast);
  cursor: not-allowed; opacity: 0.6;
}
.cloud-btn:hover { border-color: rgba(123, 47, 255, 0.4); }
.upload-zone-limit { font-size: var(--fs-xs); color: var(--text-muted); margin-top: var(--space-sm); }
.upload-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; }

/* File List */
.file-list { margin-top: var(--space-lg); display: flex; flex-direction: column; gap: var(--space-sm); }
.file-item {
  display: flex; align-items: center; gap: var(--space-md);
  padding: var(--space-md); background: rgba(30, 21, 64, 0.8);
  border: 1px solid rgba(123, 47, 255, 0.2);
  border-radius: var(--radius-md); animation: slideInUp 0.3s ease;
}
@keyframes slideInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.file-item-icon {
  width: 40px; height: 40px; background: rgba(123, 47, 255, 0.15);
  border-radius: var(--radius-sm); display: flex; align-items: center;
  justify-content: center; color: var(--primary-light); flex-shrink: 0;
}
.file-item-icon i { width: 20px; height: 20px; }
.file-item-info { flex: 1; min-width: 0; }
.file-item-name { font-weight: 500; font-size: var(--fs-base); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item-size { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--text-muted); }
.file-item-remove {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all var(--transition-fast); flex-shrink: 0;
}
.file-item-remove:hover { background: var(--error-light); color: var(--error); }
.file-item-drag { width: 20px; height: 20px; color: var(--text-muted); cursor: grab; flex-shrink: 0; }

/* Options Panel */
.options-panel {
  margin-top: var(--space-lg); background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-lg); animation: expandIn 0.3s ease;
}
@keyframes expandIn { from { opacity: 0; transform: scaleY(0.95); } to { opacity: 1; transform: scaleY(1); } }
.options-title { font-size: var(--fs-md); font-weight: 600; margin-bottom: var(--space-md); }

/* Compression Cards */
.compression-levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-sm); }
.compression-card {
  padding: var(--space-md); border: 2px solid var(--border);
  border-radius: var(--radius-md); text-align: center;
  cursor: pointer; transition: all var(--transition-base); background: transparent;
}
.compression-card:hover { border-color: rgba(123, 47, 255, 0.5); }
.compression-card.selected { border-color: var(--primary); background: rgba(123, 47, 255, 0.1); }
.compression-card i { width: 28px; height: 28px; margin: 0 auto var(--space-sm); color: var(--primary-light); }
.compression-card-title { font-weight: 600; font-size: var(--fs-sm); margin-bottom: 4px; }
.compression-card-desc { font-size: var(--fs-xs); color: var(--text-muted); }

/* Radio + Inputs */
.radio-group { display: flex; flex-direction: column; gap: var(--space-sm); }
.radio-option {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md); border-radius: var(--radius-md);
  cursor: pointer; transition: background var(--transition-fast);
}
.radio-option:hover { background: rgba(123, 47, 255, 0.08); }
.radio-circle {
  width: 20px; height: 20px; border: 2px solid var(--border-bright);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all var(--transition-fast);
}
.radio-option.selected .radio-circle { border-color: var(--primary); }
.radio-option.selected .radio-circle::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }

.input-group { margin-top: var(--space-md); }
.input-label { display: block; font-size: var(--fs-sm); font-weight: 500; margin-bottom: 6px; color: var(--text-secondary); }
.text-input {
  width: 100%; padding: 10px 14px; border: 1px solid rgba(123, 47, 255, 0.3);
  border-radius: var(--radius-md); font-size: var(--fs-base);
  color: var(--text-main); background: var(--bg-base); transition: all var(--transition-fast);
}
.text-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(123, 47, 255, 0.2); }
.text-input.error { border-color: var(--error); }
.input-error { font-size: var(--fs-xs); color: var(--error); margin-top: 4px; }

/* Position Grid */
.position-grid { display: grid; grid-template-columns: repeat(3, 40px); gap: 4px; margin-top: var(--space-sm); }
.position-cell {
  width: 40px; height: 40px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); display: flex; align-items: center;
  justify-content: center; cursor: pointer; font-size: var(--fs-xs);
  transition: all var(--transition-fast); color: var(--text-muted);
}
.position-cell:hover { border-color: var(--primary-light); color: var(--text-main); }
.position-cell.selected { background: var(--primary); border-color: var(--primary); color: white; }

/* Password */
.password-group { position: relative; }
.password-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); padding: 4px; }
.password-toggle:hover { color: var(--text-main); }
.password-strength { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.1); margin-top: var(--space-sm); overflow: hidden; }
.password-strength-bar { height: 100%; border-radius: 2px; transition: width var(--transition-base), background var(--transition-base); }

/* Slider */
.slider-group { margin-top: var(--space-md); }
.slider-input {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 3px;
  background: rgba(123, 47, 255, 0.2); outline: none; margin: var(--space-sm) 0;
}
.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); cursor: pointer;
  box-shadow: 0 0 8px rgba(57, 255, 20, 0.5);
}
.slider-value { font-size: var(--fs-sm); color: var(--text-secondary); text-align: right; }

/* Action Area */
.action-area { margin-top: var(--space-xl); text-align: center; }
.action-btn {
  width: 100%; padding: 16px 32px; font-size: var(--fs-lg);
  border-radius: var(--radius-md); background: var(--accent);
  color: var(--text-inverse); font-weight: 700;
  box-shadow: var(--glow-btn);
}
.action-btn:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 6px 28px rgba(57, 255, 20, 0.5); }
.action-btn .spinner {
  width: 20px; height: 20px; border: 2px solid rgba(0,0,0,0.2);
  border-top-color: var(--text-inverse); border-radius: 50%;
  animation: spin 0.6s linear infinite; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Progress */
.progress-container { margin-top: var(--space-md); display: none; }
.progress-container.active { display: block; animation: fadeIn 0.3s ease; }
.progress-bar-track { width: 100%; height: 8px; background: rgba(123, 47, 255, 0.15); border-radius: 4px; overflow: hidden; }
.progress-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px; transition: width 0.3s ease; position: relative;
}
.progress-bar-fill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 1.5s ease infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.progress-text { font-size: var(--fs-sm); color: var(--text-secondary); margin-top: var(--space-sm); text-align: center; }

/* Result */
.result-section { margin-top: var(--space-xl); text-align: center; animation: slideInUp 0.4s ease; }
.result-success-icon {
  width: 72px; height: 72px; margin: 0 auto var(--space-md);
  background: rgba(57, 255, 20, 0.12); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 30px rgba(57, 255, 20, 0.2);
}
@keyframes scaleIn { from { transform: scale(0); } to { transform: scale(1); } }
.result-success-icon i { width: 36px; height: 36px; }
.result-info { font-size: var(--fs-sm); color: var(--text-secondary); margin-bottom: var(--space-lg); }
.result-size-compare { display: flex; align-items: center; justify-content: center; gap: var(--space-md); margin-bottom: var(--space-md); }
.result-size .old { text-decoration: line-through; color: var(--text-muted); }
.result-size .new { font-weight: 600; color: var(--accent); }
.result-reduction { background: var(--success-light); color: var(--accent); padding: 2px 8px; border-radius: var(--radius-full); font-size: var(--fs-xs); font-weight: 600; }
.result-actions { display: flex; flex-direction: column; align-items: center; gap: var(--space-sm); }
.result-share { display: flex; align-items: center; gap: var(--space-sm); margin-top: var(--space-md); }
.share-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all var(--transition-fast);
}
.share-btn:hover { border-color: var(--primary); color: var(--primary-light); background: rgba(123, 47, 255, 0.1); }

/* Upsell Banner */
.upsell-banner {
  background: rgba(123, 47, 255, 0.08); border: 1px solid rgba(123, 47, 255, 0.2);
  border-radius: var(--radius-lg); padding: var(--space-md) var(--space-lg);
  display: flex; align-items: center; justify-content: space-between;
  margin-top: var(--space-xl); gap: var(--space-md);
}
.upsell-banner p { font-size: var(--fs-sm); color: var(--text-secondary); }
.upsell-banner a { color: var(--accent); font-weight: 600; white-space: nowrap; }

@media (max-width: 768px) {
  .tool-header h1 { font-size: var(--fs-2xl); }
  .compression-levels { grid-template-columns: 1fr; }
  .upsell-banner { flex-direction: column; text-align: center; }
}
