/* =============================================
   Audit SEO — Custom Styles
   ============================================= */

/* Loading spinner */
.loading-spinner {
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Score gauge arc animation */
@keyframes drawArc {
  from { stroke-dashoffset: 471; }
}

/* Fade in up */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up {
  animation: fadeInUp 0.4s ease forwards;
}

/* Staggered card animation */
.check-card {
  animation: fadeInUp 0.4s ease both;
}
.check-card:nth-child(1) { animation-delay: 0.05s; }
.check-card:nth-child(2) { animation-delay: 0.10s; }
.check-card:nth-child(3) { animation-delay: 0.15s; }
.check-card:nth-child(4) { animation-delay: 0.20s; }
.check-card:nth-child(5) { animation-delay: 0.25s; }
.check-card:nth-child(6) { animation-delay: 0.30s; }
.check-card:nth-child(7) { animation-delay: 0.35s; }
.check-card:nth-child(8) { animation-delay: 0.40s; }
.check-card:nth-child(9) { animation-delay: 0.45s; }
.check-card:nth-child(10){ animation-delay: 0.50s; }

/* Status colors */
.status-good    { --status-bg: #f0fdf4; --status-border: #bbf7d0; --status-icon: #16a34a; --status-text: #15803d; }
.status-warning { --status-bg: #fffbeb; --status-border: #fde68a; --status-icon: #d97706; --status-text: #b45309; }
.status-error   { --status-bg: #fef2f2; --status-border: #fecaca; --status-icon: #dc2626; --status-text: #b91c1c; }
.status-na      { --status-bg: #f8fafc; --status-border: #e2e8f0; --status-icon: #94a3b8; --status-text: #64748b; }

.check-card {
  background: var(--status-bg);
  border: 1.5px solid var(--status-border);
  border-radius: 1rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: box-shadow 0.15s;
}
.check-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.check-card .card-icon {
  width: 2rem;
  height: 2rem;
  background: var(--status-icon);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.check-card .card-title {
  font-weight: 700;
  font-size: 0.875rem;
  color: #111827;
}
.check-card .card-status {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--status-text);
}
.check-card .card-detail {
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.4;
}
.check-card .card-points {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--status-text);
  background: var(--status-border);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  width: fit-content;
}

/* Score progress bars */
.score-bar-track {
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
}

/* Priority badges */
.priority-critical { background: #fee2e2; color: #b91c1c; }
.priority-high     { background: #ffedd5; color: #c2410c; }
.priority-medium   { background: #fef9c3; color: #854d0e; }
.priority-low      { background: #f0fdf4; color: #15803d; }

/* Recommendation cards */
.rec-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  animation: fadeInUp 0.4s ease both;
  transition: box-shadow 0.15s;
}
.rec-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.rec-card .rec-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.rec-card .priority-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}
.rec-card .rec-issue { font-weight: 700; font-size: 0.9rem; color: #111827; }
.rec-card .rec-impact { font-size: 0.75rem; color: #6b7280; }
.rec-card .rec-fix {
  background: #f8fafc;
  border-left: 3px solid #2563eb;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: #374151;
  border-radius: 0 0.5rem 0.5rem 0;
}
.rec-card .affiliate-box {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 1px solid #bfdbfe;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}
.rec-card .affiliate-box .aff-name { font-weight: 700; font-size: 0.8rem; color: #1e40af; }
.rec-card .affiliate-box .aff-desc { font-size: 0.7rem; color: #3b82f6; }
.rec-card .affiliate-box .aff-cta {
  background: #2563eb;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: 0.5rem;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}
.rec-card .affiliate-box .aff-cta:hover { background: #1d4ed8; }

/* Affiliate sidebar cards */
.aff-card {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.875rem;
  background: #fafafa;
  transition: all 0.15s;
}
.aff-card:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
  box-shadow: 0 2px 8px rgba(37,99,235,0.08);
}
.aff-card .aff-emoji {
  font-size: 1.5rem;
  width: 2.25rem;
  text-align: center;
  flex-shrink: 0;
}
.aff-card .aff-body { flex: 1; min-width: 0; }
.aff-card .aff-name { font-weight: 700; font-size: 0.8rem; color: #1e40af; }
.aff-card .aff-desc { font-size: 0.7rem; color: #6b7280; margin-top: 1px; line-height: 1.3; }
.aff-card .aff-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  background: #dcfce7;
  color: #15803d;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  margin-top: 0.25rem;
}
.aff-card a {
  font-size: 0.7rem;
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.aff-card a:hover { text-decoration: underline; }

/* Quick stats */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.8rem;
}
.stat-row:last-child { border-bottom: none; }
.stat-label { color: #6b7280; }
.stat-value { font-weight: 700; color: #111827; }

/* Toast */
#toast {
  transition: opacity 0.3s ease;
}
#toast.show {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
}

/* Demo mode banner */
.demo-banner {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* Loading step indicators */
.check-step .step-icon { transition: all 0.3s; }
.check-step.done .step-icon { background: #dcfce7; }
.check-step.active .step-icon { background: #dbeafe; animation: pulse 1s infinite; }
@keyframes pulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.1); }
}

/* SERP Preview */
#serp-preview { font-family: arial, sans-serif; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Social Preview */
#og-preview, #twitter-preview { overflow: hidden; transition: box-shadow 0.15s; }
#og-preview:hover, #twitter-preview:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

/* Quick Fix cards */
.quickfix-card {
  animation: fadeInUp 0.4s ease both;
}
.quickfix-card pre {
  scrollbar-width: thin;
  scrollbar-color: #374151 #111827;
}
.quickfix-card pre::-webkit-scrollbar { height: 6px; }
.quickfix-card pre::-webkit-scrollbar-track { background: #111827; border-radius: 3px; }
.quickfix-card pre::-webkit-scrollbar-thumb { background: #374151; border-radius: 3px; }
.quickfix-card .copy-btn:active { transform: scale(0.95); }

/* Responsive adjustments */
@media (max-width: 640px) {
  .check-card { padding: 1rem; }
  .rec-card .affiliate-box { flex-direction: column; }
}

/* Print styles for PDF */
@media print {
  header, footer, #email-capture-section, #affiliate-sidebar, .share-box { display: none !important; }
}
