/* APA Style Formatter — WordPress Plugin Styles */

.asf-root { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: #1a1a1a; max-width: 900px; margin: 0 auto; }
.asf-hidden { display: none !important; }
.asf-view { width: 100%; }
.asf-mt { margin-top: 24px; }

/* ── Upload view ── */
.asf-hero { text-align: center; margin-bottom: 32px; }
.asf-title { font-size: 2rem; font-weight: 700; color: #111; margin: 0 0 8px; }
.asf-subtitle { color: #6b7280; font-size: 1rem; margin: 0; }

.asf-dropzone {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 200px; border: 2px dashed #d1d5db; border-radius: 16px;
  background: #f9fafb; cursor: pointer; transition: all .2s ease; outline: none;
}
.asf-dropzone:hover, .asf-dropzone:focus { border-color: #3b82f6; background: #eff6ff; }
.asf-dropzone--drag { border-color: #3b82f6; background: #dbeafe; transform: scale(1.01); }
.asf-dropzone--selected { border-color: #3b82f6; background: #eff6ff; border-style: solid; }
.asf-file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

.asf-drop-content { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px; text-align: center; }
.asf-drop-icon { font-size: 3rem; color: #9ca3af; line-height: 1; }
.asf-file-icon { font-size: 2.5rem; line-height: 1; }
.asf-drop-label { font-size: 1.1rem; font-weight: 600; color: #374151; margin: 0; }
.asf-drop-sub { font-size: .9rem; color: #6b7280; margin: 0; }
.asf-link { color: #3b82f6; font-weight: 500; }
.asf-type-badges { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.asf-badge { font-size: .75rem; font-weight: 600; padding: 3px 10px; border: 1px solid #e5e7eb; border-radius: 99px; background: #fff; color: #6b7280; }
.asf-size-note { font-size: .75rem; color: #9ca3af; margin: 0; }
.asf-clear-btn { background: none; border: none; color: #9ca3af; cursor: pointer; font-size: .85rem; display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 6px; }
.asf-clear-btn:hover { color: #ef4444; background: #fef2f2; }

.asf-error-box { padding: 12px 16px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; color: #dc2626; font-size: .9rem; margin-top: 12px; }

.asf-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border-radius: 10px; font-size: .95rem; font-weight: 600; cursor: pointer; border: none; transition: all .15s; text-decoration: none; }
.asf-btn-primary { background: #2563eb; color: #fff; width: 100%; justify-content: center; margin-top: 16px; }
.asf-btn-primary:hover { background: #1d4ed8; }
.asf-btn-blue { background: #3b82f6; color: #fff; }
.asf-btn-blue:hover { background: #2563eb; }
.asf-btn-violet { background: #7c3aed; color: #fff; }
.asf-btn-violet:hover { background: #6d28d9; }
.asf-btn-ghost { background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }
.asf-btn-ghost:hover { background: #e5e7eb; }
.asf-btn:disabled { opacity: .6; cursor: not-allowed; }

.asf-disclaimer { margin-top: 20px; padding: 14px 16px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; font-size: .82rem; color: #92400e; line-height: 1.5; }

.asf-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
.asf-step { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; text-align: center; }
.asf-step-num { display: block; font-size: 1.6rem; font-weight: 700; color: #2563eb; }
.asf-step-label { display: block; font-size: .9rem; font-weight: 600; color: #111; margin-top: 4px; }
.asf-step-desc { display: block; font-size: .78rem; color: #9ca3af; margin-top: 2px; }

/* ── Progress view ── */
.asf-progress-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; padding: 48px 32px; text-align: center; }
.asf-spinner { width: 48px; height: 48px; border: 4px solid #e5e7eb; border-top-color: #3b82f6; border-radius: 50%; animation: asf-spin .8s linear infinite; margin: 0 auto 20px; }
@keyframes asf-spin { to { transform: rotate(360deg); } }
.asf-progress-label { font-size: 1.1rem; font-weight: 600; color: #111; margin: 0 0 8px; }
.asf-progress-sub { color: #6b7280; font-size: .9rem; margin: 0; }

/* ── Results view ── */
.asf-results-header { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: start; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 16px; padding: 24px; margin-bottom: 20px; }

/* Score card */
.asf-score-card { min-width: 200px; }
.asf-score-inner { position: relative; width: 120px; height: 120px; margin: 0 auto 12px; }
.asf-score-ring { transform: rotate(-90deg); width: 100%; height: 100%; }
.asf-ring-progress { transition: stroke-dashoffset .7s ease; }
.asf-score-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.asf-score-num { font-size: 2rem; font-weight: 700; color: #111; line-height: 1; }
.asf-score-denom { font-size: .75rem; color: #9ca3af; }
.asf-score-label { font-size: 1.3rem; font-weight: 700; text-align: center; margin: 0 0 4px; }
.asf-score-sub { text-align: center; font-size: .85rem; color: #6b7280; margin: 0 0 12px; }
.asf-severity-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.asf-sev { background: #fff; border-radius: 8px; padding: 8px 4px; text-align: center; border: 1px solid #f3f4f6; }
.asf-sev span { display: block; font-size: 1.3rem; font-weight: 700; }
.asf-sev small { font-size: .7rem; color: #9ca3af; }
.asf-sev-high span { color: #dc2626; }
.asf-sev-medium span { color: #d97706; }
.asf-sev-low span { color: #16a34a; }

.asf-results-meta { display: flex; flex-direction: column; gap: 12px; }
.asf-doc-info { font-size: .85rem; color: #6b7280; margin: 0; }
.asf-download-panel { display: flex; flex-wrap: wrap; gap: 10px; }

.asf-summary-box { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; font-size: .9rem; color: #374151; line-height: 1.6; margin-bottom: 20px; }

/* Filter bar */
.asf-filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.asf-filter-label { font-size: .82rem; font-weight: 600; color: #6b7280; }
.asf-filter-btn { padding: 5px 13px; border-radius: 8px; font-size: .82rem; font-weight: 500; border: 1px solid #e5e7eb; background: #fff; color: #6b7280; cursor: pointer; transition: all .15s; }
.asf-filter-btn:hover { background: #f3f4f6; }
.asf-filter-active { background: #1f2937 !important; color: #fff !important; border-color: #1f2937 !important; }
.asf-filter-btn[data-filter="high"].asf-filter-active { background: #dc2626 !important; border-color: #dc2626 !important; }
.asf-filter-btn[data-filter="medium"].asf-filter-active { background: #d97706 !important; border-color: #d97706 !important; }
.asf-filter-btn[data-filter="low"].asf-filter-active { background: #16a34a !important; border-color: #16a34a !important; }

/* Issues */
.asf-issues-list { display: flex; flex-direction: column; gap: 8px; }
.asf-no-issues { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px; padding: 24px; text-align: center; color: #15803d; font-weight: 500; }

.asf-issue { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; border-left: 4px solid #e5e7eb; overflow: hidden; }
.asf-issue--high   { border-left-color: #ef4444; }
.asf-issue--medium { border-left-color: #f59e0b; }
.asf-issue--low    { border-left-color: #10b981; }

.asf-issue-header { width: 100%; text-align: left; background: none; border: none; padding: 14px 16px; display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.asf-issue-header:hover { background: #f9fafb; }
.asf-sev-badge { flex-shrink: 0; padding: 3px 10px; border-radius: 99px; font-size: .72rem; font-weight: 700; margin-top: 2px; }
.asf-sev-badge--high   { background: #fee2e2; color: #b91c1c; }
.asf-sev-badge--medium { background: #fef3c7; color: #b45309; }
.asf-sev-badge--low    { background: #d1fae5; color: #065f46; }
.asf-issue-meta { flex: 1; min-width: 0; }
.asf-issue-cat { display: block; font-size: .7rem; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.asf-issue-title { display: block; font-size: .9rem; font-weight: 600; color: #111; line-height: 1.3; }
.asf-issue-loc { display: block; font-size: .75rem; color: #9ca3af; margin-top: 3px; }
.asf-issue-chevron { flex-shrink: 0; font-size: 1rem; color: #9ca3af; margin-top: 2px; }

.asf-issue-body { padding: 0 16px 16px; border-top: 1px solid #f3f4f6; display: flex; flex-direction: column; gap: 12px; }
.asf-issue-section { padding-top: 12px; }
.asf-issue-section-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #9ca3af; margin: 0 0 4px; }
.asf-issue-section p { font-size: .88rem; color: #374151; line-height: 1.55; margin: 0; }
.asf-fix-box { background: #f9fafb; border-radius: 8px; padding: 10px 12px !important; }
.asf-guidance { font-style: italic; color: #6b7280 !important; }

/* Recommendations */
.asf-recommendations { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 20px; margin-top: 20px; }
.asf-rec-title { font-size: 1rem; font-weight: 700; color: #111; margin: 0 0 16px; }
.asf-rec-group { margin-bottom: 16px; }
.asf-rec-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; margin: 0 0 6px; }
.asf-recommendations ul { margin: 0; padding-left: 18px; }
.asf-recommendations li { font-size: .88rem; color: #374151; line-height: 1.5; margin-bottom: 4px; }

/* Error view */
.asf-error-card { background: #fef2f2; border: 1px solid #fecaca; border-radius: 16px; padding: 48px 32px; text-align: center; }
.asf-error-icon { font-size: 2.5rem; margin-bottom: 12px; }
.asf-error-title { font-size: 1.2rem; font-weight: 700; color: #991b1b; margin: 0 0 8px; }
.asf-error-msg { color: #b91c1c; font-size: .9rem; margin: 0 0 20px; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .asf-title { font-size: 1.5rem; }
  .asf-results-header { grid-template-columns: 1fr; }
  .asf-steps { grid-template-columns: 1fr; }
  .asf-download-panel { flex-direction: column; }
  .asf-btn { width: 100%; justify-content: center; }
}
