/* ConvertNix - Tool Page & Custom Tool Controls CSS */

/* Tool Page Wrapper */
.tool-page-container {
  max-width: 960px;
  margin: 0 auto;
}

.tool-page-header {
  margin-bottom: 2rem;
  text-align: center;
}

.tool-page-header .tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.85rem;
  background: var(--light-red);
  color: var(--primary-red);
  font-weight: 600;
  font-size: 0.8rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tool-page-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.tool-page-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto;
}

/* Tool Main Card Container */
.tool-workspace-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 2.5rem;
}

/* Common Control Panels */
.tool-options-panel {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
}

.option-group label span.val {
  color: var(--primary-red);
}

.form-control, .form-select, .form-range {
  width: 100%;
  padding: 0.65rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-red);
}

textarea.form-control {
  min-height: 140px;
  resize: vertical;
  font-family: var(--font-mono);
}

/* Buttons & Action Bars */
.tool-action-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
  color: white;
  font-weight: 600;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-red);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(229, 57, 53, 0.35);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  font-weight: 600;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

/* Result Box */
.tool-result-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tool-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
}

.tool-result-header h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.result-content-box {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  max-height: 350px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Specific Preview Boxes */
.canvas-preview-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-conic-gradient(#E2E8F0 0% 25%, #FFFFFF 0% 50%) 50% / 16px 16px;
  border-radius: var(--radius-lg);
  padding: 1rem;
  min-height: 220px;
  max-height: 480px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

[data-theme="dark"] .canvas-preview-container {
  background: repeating-conic-gradient(#1E293B 0% 25%, #0F172A 0% 50%) 50% / 16px 16px;
}

.canvas-preview-container img, .canvas-preview-container canvas {
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

/* Color Tool Components */
.color-swatch-display {
  height: 140px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.25rem;
  transition: background-color var(--transition-fast);
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.palette-swatch {
  height: 100px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0.75rem;
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.palette-swatch:hover {
  transform: scale(1.04);
}

/* Progress bar UI */
.progress-bar-wrapper {
  width: 100%;
  height: 8px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 1rem 0;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-red), var(--dark-red));
  width: 0%;
  transition: width 0.3s ease;
}

/* Stat Grid for Text Tools & Calculators */
.stat-box-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.stat-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

.stat-card .stat-val {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary-red);
}

.stat-card .stat-lbl {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-top: 0.25rem;
}

/* SEO FAQ Section */
.tool-seo-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-top: 2.5rem;
}

.tool-seo-section h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.tool-seo-section p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  background: var(--bg-input);
}

.faq-item h5 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.faq-item p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}
