/**
 * Bulk DA, PA & Spam Score Checker - Premium Stylesheet
 * Scoped to avoid conflicts with SimpleX theme
 */

:root {
  --dapa-primary: #2563eb;
  --dapa-primary-hover: #1d4ed8;
  --dapa-success: #10b981;
  --dapa-warning: #f59e0b;
  --dapa-danger: #ef4444;
  --dapa-info: #06b6d4;
  --dapa-dark: #1e293b;
  --dapa-light: #f8fafc;
  --dapa-border: #e2e8f0;
  --dapa-radius: 12px;
  --dapa-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

.dapa-checker-wrapper {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #334155;
  margin-bottom: 40px;
}

/* Header & Badges */
.dapa-hero-header {
  margin-bottom: 24px;
}

.dapa-hero-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 10px 0;
  line-height: 1.3;
}

.dapa-hero-subtitle {
  font-size: 15px;
  color: #64748b;
  line-height: 1.6;
  margin: 0 0 16px 0;
}

.dapa-meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
}

.dapa-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
}

.dapa-badge-moz {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.dapa-badge-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: dapaPulse 2s infinite;
}

.dapa-badge-offline {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.dapa-badge-offline .dapa-badge-pulse {
  background: #f59e0b;
}

@keyframes dapaPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Card Container */
.dapa-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--dapa-radius);
  box-shadow: var(--dapa-shadow);
  padding: 24px;
  margin-bottom: 28px;
  transition: box-shadow 0.2s ease;
}

.dapa-card:hover {
  box-shadow: 0 14px 30px -4px rgba(0, 0, 0, 0.08);
}

/* Alert Boxes */
.dapa-alert {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
}

.dapa-alert-warning {
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.dapa-alert-danger {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.dapa-alert-info {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.dapa-alert-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Textarea & Input */
.dapa-input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.dapa-input-label {
  font-weight: 600;
  font-size: 14px;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.dapa-input-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dapa-btn-sm {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dapa-btn-sm:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.dapa-textarea-wrapper {
  position: relative;
  margin-bottom: 14px;
}

.dapa-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 180px;
  padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13.5px;
  line-height: 1.6;
  color: #1e293b;
  background: #fdfdfd;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.dapa-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  background: #ffffff;
}

.dapa-input-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: #64748b;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 8px;
}

.dapa-url-counter {
  font-weight: 600;
  color: #2563eb;
}

/* Submit Button */
.dapa-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
  min-width: 220px;
}

.dapa-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.dapa-btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Loading Indicator */
.dapa-loader {
  display: none;
  padding: 30px 20px;
  text-align: center;
}

.dapa-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: dapaSpin 0.8s linear infinite;
  margin: 0 auto 16px auto;
}

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

.dapa-loader-text {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 6px;
}

.dapa-loader-subtext {
  font-size: 13px;
  color: #64748b;
}

/* Summary Grid */
.dapa-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.dapa-summary-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 14px;
  text-align: center;
  transition: transform 0.15s ease;
}

.dapa-summary-card:hover {
  transform: translateY(-2px);
  background: #ffffff;
}

.dapa-summary-val {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
  margin-bottom: 4px;
}

.dapa-summary-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
}

/* Results Table */
.dapa-table-responsive {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-bottom: 20px;
}

.dapa-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
  background: #ffffff;
}

.dapa-table th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 2px solid #cbd5e1;
  white-space: nowrap;
}

.dapa-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.dapa-table tr:hover td {
  background-color: #f8fafc;
}

.dapa-domain-cell {
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
  word-break: break-all;
}

.dapa-domain-link {
  color: #2563eb;
  text-decoration: none;
}

.dapa-domain-link:hover {
  text-decoration: underline;
}

/* Metric Pill Badges */
.dapa-metric-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  min-width: 44px;
  padding: 4px 10px;
  border-radius: 14px;
  color: #ffffff;
}

.dapa-pill-high {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.dapa-pill-med {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
}

.dapa-pill-mod {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
}

.dapa-pill-low {
  background: linear-gradient(135deg, #64748b 0%, #94a3b8 100%);
}

/* Spam Score Badge */
.dapa-spam-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

.dapa-spam-clean {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.dapa-spam-medium {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.dapa-spam-high {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.dapa-spam-unknown {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.dapa-cache-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e0f2fe;
  color: #0369a1;
}

.dapa-live-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f0fdf4;
  color: #15803d;
}

/* Results Actions Toolbar */
.dapa-results-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.dapa-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.dapa-btn-outline:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.dapa-btn-success {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
}

.dapa-btn-success:hover {
  background: #059669;
  border-color: #059669;
  color: #ffffff;
}

/* Content & Editorial Styling */
.dapa-content-section {
  color: #334155;
  line-height: 1.75;
  font-size: 15px;
  margin-top: 36px;
}

.dapa-content-section h2 {
  font-size: 23px;
  font-weight: 700;
  color: #0f172a;
  margin: 32px 0 14px 0;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 8px;
}

.dapa-content-section h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  margin: 22px 0 10px 0;
}

.dapa-content-section p {
  margin: 0 0 16px 0;
}

.dapa-content-section ul, 
.dapa-content-section ol {
  margin: 0 0 20px 0;
  padding-left: 24px;
}

.dapa-content-section li {
  margin-bottom: 8px;
}

/* Steps Grid */
.dapa-steps-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 20px 0 28px 0;
}

.dapa-step-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 18px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.dapa-step-card:hover {
  border-color: #bfdbfe;
  transform: translateY(-2px);
  background: #ffffff;
}

.dapa-step-badge {
  display: inline-block;
  background: #2563eb;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  margin-bottom: 8px;
}

.dapa-step-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 6px 0;
}

.dapa-step-desc {
  font-size: 13.5px;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

/* Editorial Tables */
.dapa-content-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 26px 0;
  font-size: 14px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
}

.dapa-content-table th {
  background: #f1f5f9;
  color: #1e293b;
  font-weight: 700;
  padding: 12px 16px;
  border: 1px solid #cbd5e1;
  text-align: left;
}

.dapa-content-table td {
  padding: 11px 16px;
  border: 1px solid #e2e8f0;
  color: #334155;
}

.dapa-content-table tr:nth-child(even) td {
  background-color: #f8fafc;
}

/* FAQ Accordion */
.dapa-faq-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}

.dapa-faq-question {
  padding: 16px 20px;
  font-size: 15.5px;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  transition: background-color 0.15s ease;
  user-select: none;
}

.dapa-faq-question:hover {
  background: #f8fafc;
}

.dapa-faq-toggle {
  font-size: 18px;
  color: #2563eb;
  transition: transform 0.2s ease;
}

.dapa-faq-card.active .dapa-faq-toggle {
  transform: rotate(45deg);
}

.dapa-faq-answer {
  display: none;
  padding: 0 20px 16px 20px;
  font-size: 14.5px;
  color: #475569;
  line-height: 1.6;
  border-top: 1px solid #f1f5f9;
}

.dapa-faq-card.active .dapa-faq-answer {
  display: block;
  padding-top: 14px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .dapa-hero-header h1 {
    font-size: 22px;
  }
  .dapa-card {
    padding: 16px;
  }
  .dapa-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dapa-results-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .dapa-btn-outline, .dapa-btn-primary {
    width: 100%;
    justify-content: center;
  }
}
