/* ============================================
   SmartCAD — Tool Page Stylesheet
   ============================================ */

.tool-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  width: 100%;
}

.tool-header {
  margin-bottom: 24px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.breadcrumb a {
  color: var(--text-alt);
  text-decoration: none;
}

.breadcrumb a:hover { color: var(--primary); }

.tool-header h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}

.tool-header p {
  color: var(--text-alt);
  font-size: 15px;
}

/* ============ Drop Zone ============ */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-card);
  margin: 24px 0;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.drop-zone-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

.drop-zone h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.drop-zone p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 16px;
}

.drop-zone .btn {
  margin-top: 8px;
}

.file-input { display: none; }

/* ============ Toolbar ============ */
.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.toolbar-group {
  display: flex;
  gap: 4px;
  align-items: center;
}

.toolbar-group + .toolbar-group {
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.toolbar-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-right: 4px;
}

.tool-btn {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: var(--transition);
  color: var(--text);
}

.tool-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.tool-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.tool-btn-wide {
  width: auto;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
}

/* ============ Viewer Canvas ============ */
.viewer-wrap {
  position: relative;
  background: #0a0a0a;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.viewer-canvas {
  display: block;
  width: 100%;
  height: 500px;
  cursor: grab;
}

.viewer-canvas:active { cursor: grabbing; }

.viewer-info {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-family: var(--mono);
}

.viewer-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.85);
  color: white;
  font-size: 14px;
  gap: 12px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============ Convert Box ============ */
.convert-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 16px;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.file-info-icon {
  font-size: 32px;
}

.file-info-details {
  flex: 1;
}

.file-info-details h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  word-break: break-all;
}

.file-info-details p {
  font-size: 12px;
  color: var(--text-muted);
}

.convert-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============ Status ============ */
.status-msg {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-top: 16px;
}

.status-success {
  background: #ecfdf5;
  color: #065f46;
  border-left: 4px solid #10b981;
}

.status-error {
  background: #fef2f2;
  color: #991b1b;
  border-left: 4px solid #ef4444;
}

.status-info {
  background: var(--primary-bg);
  color: var(--primary-dark);
  border-left: 4px solid var(--primary);
}

[data-theme="dark"] .status-success {
  background: #064e3b;
  color: #6ee7b7;
}

[data-theme="dark"] .status-error {
  background: #7f1d1d;
  color: #fca5a5;
}

/* ============ Related Tools ============ */
.related-tools {
  margin-top: 48px;
}

.related-tools h2 {
  font-size: 20px;
  margin-bottom: 16px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.related-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
}

.related-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.related-card span:first-child { font-size: 24px; }

.related-card h4 {
  font-size: 14px;
  font-weight: 600;
}

@media (max-width: 768px) {
  .tool-header h1 { font-size: 24px; }
  .viewer-canvas { height: 320px; }
  .toolbar { padding: 8px; }
}

/* ═══════════════════════════════════════════
   SEO Sections (How to Use, About, FAQ)
   ═══════════════════════════════════════════ */

.tool-seo-section {
  margin-top: 48px;
  padding: 32px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.tool-seo-section h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.tool-seo-section h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--text);
}

.tool-seo-section p {
  font-size: 15px;
  color: var(--text-alt);
  line-height: 1.8;
  margin-bottom: 16px;
}

/* How to Use (Ordered List) */
.tool-steps {
  list-style: none;
  counter-reset: step-counter;
  padding: 0;
  margin: 0;
}

.tool-steps li {
  counter-increment: step-counter;
  position: relative;
  padding: 16px 16px 16px 64px;
  margin-bottom: 12px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border-left: 3px solid var(--primary);
  font-size: 15px;
  color: var(--text-alt);
  line-height: 1.6;
}

.tool-steps li::before {
  content: counter(step-counter);
  position: absolute;
  left: 16px;
  top: 16px;
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

/* Why Choose (Feature Grid) */
.tool-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.tool-feature-card {
  padding: 20px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.tool-feature-card .feature-icon {
  font-size: 32px;
  margin-bottom: 12px;
  display: block;
}

.tool-feature-card h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.tool-feature-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* FAQ (Details/Summary) */
.tool-faq {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool-faq details {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: all 0.2s ease;
}

.tool-faq details[open] {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.tool-faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.tool-faq summary::-webkit-details-marker {
  display: none;
}

.tool-faq summary::after {
  content: "▸";
  color: var(--primary);
  font-size: 20px;
  transition: transform 0.2s ease;
}

.tool-faq details[open] summary::after {
  transform: rotate(90deg);
}

.tool-faq details p {
  margin-top: 12px;
  margin-bottom: 0;
  font-size: 14px;
  line-height: 1.7;
}

/* Responsive */
@media (max-width: 768px) {
  .tool-seo-section {
    padding: 24px 16px;
    margin-top: 32px;
  }
  .tool-seo-section h2 { font-size: 20px; }
  .tool-steps li {
    padding: 14px 14px 14px 56px;
    font-size: 14px;
  }
  .tool-steps li::before {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }
}
