/* ==========================================================================
   RankCraft SEO Tools - Components Stylesheet
   Specialized Tool Interfaces, Metrics, Badges, Modals & Visualizations
   ========================================================================== */

/* Breadcrumb */
.breadcrumb-nav {
  padding: 1.25rem 0 0.5rem;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.breadcrumb-item a {
  color: var(--text-muted);
}

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

.breadcrumb-separator {
  color: var(--text-light);
}

.breadcrumb-item.active {
  color: var(--text-main);
  font-weight: 600;
}

/* Tool Header */
.tool-header-section {
  padding: 1.5rem 0 2rem;
  text-align: left;
}

.tool-header-content {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
}

.tool-page-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
  border: 1px solid rgba(37, 99, 235, 0.15);
}

.tool-title-group h1 {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--secondary);
  line-height: 1.2;
}

.tool-header-desc {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 800px;
}

/* Tool Layout Container */
.tool-workspace {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  margin-bottom: 3rem;
}

.tool-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

/* Form Controls & Inputs */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.form-label-hint {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-muted);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: #ffffff;
  color: var(--text-main);
  font-size: 0.9375rem;
  line-height: 1.5;
  transition: var(--transition);
  font-family: inherit;
}

.form-textarea {
  resize: vertical;
  min-height: 180px;
}

.form-textarea.code-font, .form-input.code-font {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  tab-size: 2;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Action Toolbars & Buttons */
.tool-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.action-btn-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1.25;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: #ffffff;
}

.btn-secondary {
  background-color: var(--secondary-light);
  border-color: var(--border);
  color: var(--secondary);
}

.btn-secondary:hover {
  background-color: #e2e8f0;
  color: var(--secondary);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--border);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--primary-light);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

.btn-danger-outline {
  background: transparent;
  border-color: #fca5a5;
  color: var(--danger);
}

.btn-danger-outline:hover {
  background-color: var(--danger-bg);
  border-color: var(--danger);
}

/* Metric Cards Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  transition: var(--transition);
}

.metric-card:hover {
  border-color: #cbd5e1;
  transform: translateY(-2px);
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.metric-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* Results & Output Area */
.output-container {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--secondary);
}

.output-content {
  padding: 1rem;
  max-height: 350px;
  overflow-y: auto;
}

.code-output {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  border-radius: var(--radius-md);
  max-height: 400px;
  overflow-y: auto;
}

/* SERP Google Preview Box */
.serp-preview-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  font-family: arial, sans-serif;
  margin-bottom: 1.5rem;
}

.serp-url {
  font-size: 14px;
  color: #202124;
  line-height: 1.3;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.serp-url-badge {
  background: #e8f0fe;
  color: #1a73e8;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-sans);
}

.serp-title {
  font-size: 20px;
  line-height: 1.3;
  color: #1a0dab;
  cursor: pointer;
  margin-bottom: 4px;
  word-break: break-word;
}

.serp-title:hover {
  text-decoration: underline;
}

.serp-desc {
  font-size: 14px;
  line-height: 1.58;
  color: #4d5156;
  word-break: break-word;
}

/* Social Card Preview */
.social-preview-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #ffffff;
  max-width: 500px;
}

.social-preview-img {
  width: 100%;
  height: 200px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  overflow: hidden;
}

.social-preview-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.social-preview-body {
  padding: 1rem;
}

.social-preview-site {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.social-preview-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--secondary);
  margin-bottom: 0.25rem;
}

.social-preview-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Drag & Drop File Upload Area */
.dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: var(--bg-page);
  cursor: pointer;
  transition: var(--transition);
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.dropzone-icon {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.dropzone-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 0.25rem;
}

.dropzone-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Score Circle Gauge (for SEO Checker) */
.score-gauge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg-page);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  text-align: center;
}

.score-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  position: relative;
  background: #ffffff;
  border: 8px solid var(--primary);
}

.score-circle.excellent { border-color: var(--success); }
.score-circle.good { border-color: var(--info); }
.score-circle.warning { border-color: var(--warning); }
.score-circle.poor { border-color: var(--danger); }

.score-number {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--secondary);
}

.score-max {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.score-status-badge {
  padding: 0.375rem 1rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.875rem;
}

.score-status-badge.excellent { background: var(--success-bg); color: var(--success); }
.score-status-badge.good { background: var(--info-bg); color: var(--info); }
.score-status-badge.warning { background: var(--warning-bg); color: var(--warning); }
.score-status-badge.poor { background: var(--danger-bg); color: var(--danger); }

/* Report Checklist Items */
.check-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}

.check-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.check-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.check-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.check-badge.passed { background: var(--success-bg); color: var(--success); }
.check-badge.warning { background: var(--warning-bg); color: var(--warning); }
.check-badge.error { background: var(--danger-bg); color: var(--danger); }

.check-card-body {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.check-fix-tip {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-page);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.8125rem;
  color: var(--secondary);
}

/* Tabs */
.tabs-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.tab-btn {
  background: none;
  border: none;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

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

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  background: var(--bg-page);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--secondary);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
}

.data-table tr:hover td {
  background: var(--primary-light);
}

/* Step by Step Guide */
.steps-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.step-content h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 0.25rem;
}

.step-content p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--secondary);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toastSlideUp 0.3s ease-out;
  pointer-events: auto;
}

.toast.success { background: #065f46; border-left: 4px solid var(--success); }
.toast.error { background: #991b1b; border-left: 4px solid var(--danger); }
.toast.info { background: #1e40af; border-left: 4px solid var(--info); }

@keyframes toastSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Range Slider */
.range-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.range-slider {
  flex: 1;
  accent-color: var(--primary);
}

.range-val {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--secondary);
  min-width: 45px;
}
