/* =====================================================
   AIToolsHub — Tool Page Specific Styles
   ===================================================== */

/* ── Drop Zone ── */
.drop-zone {
  border: 2px dashed var(--border-glow);
  border-radius: var(--radius-xl);
  padding: var(--space-3xl) var(--space-2xl);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  background: rgba(124,58,237,0.03);
  position: relative;
}

.drop-zone:hover, .drop-zone.drag-over {
  background: rgba(124,58,237,0.08);
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.drop-zone-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  display: block;
}

.drop-zone-text {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.drop-zone-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* ── File List ── */
.file-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.file-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.file-item-icon { font-size: 1.5rem; }
.file-item-name { flex: 1; font-size: 0.9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item-size { font-size: 0.75rem; color: var(--text-muted); }
.file-item-remove { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; padding: 4px; transition: color var(--transition-fast); }
.file-item-remove:hover { color: var(--danger); }

/* ── Image Preview ── */
.image-preview-container {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-surface);
}

.image-preview {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  display: block;
}

.image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  padding: var(--space-md);
  color: white;
  font-size: 0.875rem;
}

/* ── Comparison Slider ── */
.compare-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  cursor: col-resize;
  user-select: none;
}

.compare-before, .compare-after {
  position: absolute;
  top: 0; bottom: 0;
  overflow: hidden;
}

.compare-after { right: 0; left: 50%; }
.compare-handle {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  background: var(--primary);
  cursor: col-resize;
}

/* ── Password Strength ── */
.strength-bar {
  display: flex;
  gap: 4px;
  margin-top: var(--space-sm);
}

.strength-segment {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  transition: background var(--transition-base);
}

.strength-0 .strength-segment:nth-child(1) { background: var(--danger); }
.strength-1 .strength-segment:nth-child(-n+2) { background: var(--warning); }
.strength-2 .strength-segment:nth-child(-n+3) { background: var(--accent); }
.strength-3 .strength-segment { background: var(--success); }

.strength-label {
  font-size: 0.8125rem;
  font-weight: 600;
  margin-top: 4px;
}

/* ── QR Code ── */
.qr-output {
  background: white;
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

/* ── Word Stats ── */
.word-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.word-stat {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
}

.word-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: var(--font-display);
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.word-stat-label { font-size: 0.8rem; color: var(--text-muted); }

/* ── Invoice styles ── */
.invoice-preview {
  background: white;
  color: #1a1a1a;
  padding: 2rem;
  border-radius: var(--radius-lg);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  box-shadow: var(--shadow-md);
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #e2e8f0;
}

.invoice-company-name { font-size: 1.5rem; font-weight: 800; color: #7c3aed; }
.invoice-title { font-size: 2rem; font-weight: 800; color: #7c3aed; }
.invoice-table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
.invoice-table th { background: #7c3aed; color: white; padding: 0.75rem; text-align: left; }
.invoice-table td { padding: 0.75rem; border-bottom: 1px solid #e2e8f0; color: #1a1a1a; }
.invoice-total { text-align: right; padding-top: 1rem; }
.invoice-total-value { font-size: 1.5rem; font-weight: 800; color: #7c3aed; }

/* ── Unit converter ── */
.unit-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-md);
  align-items: end;
}

.unit-swap-btn {
  width: 44px; height: 44px;
  border-radius: var(--radius-full);
  background: var(--grad-primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  border: none;
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.unit-swap-btn:hover { transform: rotate(180deg); }

/* ── Resume builder ── */
.resume-preview {
  background: white;
  color: #1a1a1a;
  padding: 2rem;
  border-radius: var(--radius-lg);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  line-height: 1.6;
  box-shadow: var(--shadow-md);
  min-height: 400px;
}

.resume-header { border-bottom: 3px solid #7c3aed; padding-bottom: 1rem; margin-bottom: 1.5rem; }
.resume-name { font-size: 1.75rem; font-weight: 800; color: #1a1a1a; }
.resume-title-role { color: #7c3aed; font-weight: 600; font-size: 1rem; }
.resume-contact { font-size: 0.8rem; color: #64748b; margin-top: 0.5rem; }
.resume-section { margin-bottom: 1.25rem; }
.resume-section-title { font-size: 0.9rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #7c3aed; margin-bottom: 0.5rem; border-bottom: 1px solid #e2e8f0; padding-bottom: 0.25rem; }
.resume-item-title { font-weight: 700; }
.resume-item-subtitle { color: #475569; font-size: 0.8rem; }

/* ── Age calculator ── */
.age-display {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  text-align: center;
}

.age-unit {
  background: var(--bg-surface);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

.age-unit-value {
  font-size: 3rem;
  font-weight: 900;
  font-family: var(--font-display);
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.age-unit-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

/* ── Output section ── */
.output-section {
  margin-top: var(--space-xl);
  animation: fadeInUp 0.3s ease;
}

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.output-title { font-weight: 700; }

/* ── Options row ── */
.options-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text-secondary);
}

/* ── AI Output ── */
.ai-output {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  position: relative;
}

.ai-output-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  counter-reset: item;
}

.ai-output-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ai-output-item:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
}

.ai-item-num {
  width: 28px; height: 28px;
  border-radius: var(--radius-full);
  background: var(--grad-primary);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── Background remover ── */
.canvas-container {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

/* ── Image converter ── */
.format-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

.format-btn {
  padding: 0.625rem;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
  text-align: center;
}

.format-btn.active {
  border-color: var(--primary);
  background: rgba(124,58,237,0.1);
  color: var(--primary-light);
}

/* Responsive tool styles */
@media (max-width: 768px) {
  .word-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .age-display { grid-template-columns: 1fr; }
  .format-grid { grid-template-columns: repeat(2, 1fr); }
  .unit-row { grid-template-columns: 1fr; }
  .unit-swap-btn { width: 100%; }
}

/* Hide tool rating and usage counts globally on individual tool pages */
.tool-page-meta > span:not(.badge) {
  display: none !important;
}
