/* topical-authority-analyzer.css */
.tool-wrap { padding: 120px 5vw; min-height: 100vh; position: relative; max-width: 1400px; margin: 0 auto; }
.bg-grad { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 800px; height: 600px; background: radial-gradient(ellipse at center, rgba(29, 124, 110, 0.15) 0%, transparent 70%); pointer-events: none; z-index: -1; }

.tool-hero { text-align: center; max-width: 800px; margin: 0 auto 60px; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 100px; background: rgba(29, 124, 110, 0.1); border: 1px solid rgba(29, 124, 110, 0.3); color: var(--accent); font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 24px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.5); } 100% { opacity: 1; transform: scale(1); } }
.tool-hero h1 { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 900; line-height: 1.1; margin-bottom: 20px; text-transform: uppercase; letter-spacing: -0.02em; }
.tool-hero h1 .accent { color: var(--accent); }
.tool-subtitle { font-size: 1.1rem; color: var(--muted); line-height: 1.6; margin-bottom: 40px; }

.input-panel { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.08); border-radius: 20px; padding: 30px; backdrop-filter: blur(10px); }
.url-row { display: flex; gap: 12px; margin-bottom: 16px; }
.url-row input { flex: 1; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); color: #fff; padding: 16px 24px; border-radius: 12px; font-size: 1.1rem; transition: border-color 0.3s; }
.url-row input:focus { outline: none; border-color: var(--accent); }
.audit-btn { background: var(--accent); color: #fff; border: none; padding: 16px 32px; border-radius: 12px; font-size: 1.1rem; font-weight: 700; cursor: pointer; transition: all 0.3s; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.audit-btn:hover { background: var(--accent-hover); transform: translateY(-2px); }
.audit-btn svg { width: 20px; height: 20px; }
.url-note { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--muted); justify-content: center; }

.hidden { display: none !important; }
.loading-state { text-align: center; padding: 80px 20px; }
.spinner { width: 48px; height: 48px; border: 4px solid rgba(29, 124, 110, 0.2); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 20px; }
@keyframes spin { 100% { transform: rotate(360deg); } }
.progress-bar { width: 100%; max-width: 300px; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; margin: 20px auto 0; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); width: 0%; transition: width 0.3s ease; }

.error-state { text-align: center; padding: 60px 20px; background: rgba(255, 77, 109, 0.05); border: 1px solid rgba(255, 77, 109, 0.2); border-radius: 20px; max-width: 600px; margin: 40px auto; }
.error-icon { font-size: 40px; margin-bottom: 16px; }
.error-state h3 { color: #ff4d6d; margin-bottom: 12px; font-size: 1.5rem; }
.error-state p { color: var(--muted); margin-bottom: 24px; }
.retry-btn { background: #ff4d6d; color: #fff; border: none; padding: 12px 24px; border-radius: 8px; font-weight: 600; cursor: pointer; }

.results-dashboard { animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; flex-wrap: wrap; gap: 20px; }
.results-meta { display: flex; align-items: center; gap: 16px; }
.status-indicator { width: 12px; height: 12px; background: #4ADE80; border-radius: 50%; box-shadow: 0 0 10px #4ADE80; }
.results-meta h2 { font-size: 1.2rem; font-weight: 700; margin: 0 0 4px; color: #fff; }
.results-meta p { font-size: 0.9rem; color: var(--muted); margin: 0; }
.results-actions { display: flex; gap: 12px; }
.action-btn { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 0.9rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: all 0.2s; }
.action-btn:hover { background: rgba(255,255,255,0.1); }
.action-btn.primary { background: var(--accent); border-color: var(--accent); }
.action-btn.primary:hover { background: var(--accent-hover); }

/* Layout Grids */
.top-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 30px; }
.pillars-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 30px; }
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

@media (max-width: 1024px) {
    .top-grid, .grid-2col { grid-template-columns: 1fr; }
    .pillars-grid { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 768px) {
    .url-row { flex-direction: column; }
    .pillars-grid { grid-template-columns: 1fr !important; }
}

/* Cards */
.analysis-card, .score-card, .ai-readiness-card, .pillar-card {
    background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px; padding: 30px;
}
.full-width { margin-bottom: 30px; }

/* Score */
.main-score { display: flex; align-items: center; gap: 30px; }
.score-circle { position: relative; width: 100px; height: 100px; }
.score-circle svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-circle circle { fill: none; stroke-width: 8; stroke-linecap: round; }
.score-circle .bg { stroke: rgba(255,255,255,0.1); }
.score-circle .progress { stroke: #4ADE80; transition: stroke-dashoffset 2s cubic-bezier(0.4, 0, 0.2, 1); }
.score-val { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 1.8rem; font-weight: 800; color: #4ADE80; }
.main-score h3 { font-size: 1.2rem; margin-bottom: 8px; }
.grade-badge { display: inline-block; background: rgba(74, 222, 128, 0.15); color: #4ADE80; font-weight: 900; font-size: 1.5rem; padding: 4px 16px; border-radius: 8px; border: 1px solid rgba(74, 222, 128, 0.3); }

/* AI Cards */
.ai-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.ai-icon { font-size: 24px; }
.ai-header h3 { font-size: 1.1rem; margin: 0; }
.ai-val { font-size: 1.5rem; font-weight: 900; margin-bottom: 16px; text-transform: uppercase; color: #4ADE80; }
.engine-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 0.9rem; color: var(--muted); padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.engine-row:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.status-tag { background: rgba(255,255,255,0.1); color: #fff; padding: 2px 8px; border-radius: 4px; font-weight: 600; font-size: 0.8rem; }
.status-tag.high { background: rgba(74, 222, 128, 0.2); color: #4ADE80; }
.status-tag.mid { background: rgba(253, 203, 110, 0.2); color: #fdcb6e; }
.status-tag.low { background: rgba(255, 118, 117, 0.2); color: #ff7675; }

/* Pillars */
.pillar-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.pillar-head h4 { font-size: 1.05rem; margin-bottom: 4px; }
.pillar-score { font-size: 1.2rem; font-weight: 800; color: var(--accent-gold); }
.pillar-icon { font-size: 24px; }
.pillar-data { display: flex; flex-direction: column; gap: 12px; }
.p-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; margin-bottom: 8px; }
.p-label { color: var(--muted); }
.p-val { font-weight: 600; }
.p-val.yes { color: #4ADE80; }
.p-val.no { color: #ff7675; }

/* Missing & Recommendations */
.analysis-card h3 { margin-bottom: 20px; font-size: 1.2rem; }
.missing-list, .recommendations-list { display: flex; flex-direction: column; gap: 12px; }
.missing-item { display: flex; flex-direction: column; padding: 12px 16px; background: rgba(255, 118, 117, 0.05); border: 1px dashed rgba(255, 118, 117, 0.3); border-radius: 8px; gap: 6px; }
.missing-item .title-row { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.missing-item .impact { font-size: 0.75rem; padding: 2px 8px; border-radius: 4px; background: #ff7675; color: #fff; }
.missing-item p { font-size: 0.85rem; color: var(--muted); margin: 0; }

.rec-item { padding: 16px; background: rgba(59, 107, 255, 0.05); border-left: 3px solid #3b6bff; border-radius: 0 8px 8px 0; }
.rec-item h4 { margin: 0 0 8px 0; color: #fff; font-size: 1rem; }
.rec-item p { margin: 0; font-size: 0.85rem; color: var(--muted); line-height: 1.5; }
.rec-impact { display: inline-block; margin-top: 8px; font-size: 0.8rem; font-weight: bold; color: #4ADE80; }

/* Raw Data Section */
.card-header-flex { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.raw-data-section { padding-top: 10px; }
.raw-title { font-size: 1.1rem; color: #fff; margin: 0 0 4px 0; }
.raw-subtitle { font-size: 0.85rem; color: var(--muted); margin: 0 0 16px 0; }
.raw-data-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; padding-right: 10px; }
.raw-data-list::-webkit-scrollbar { width: 6px; }
.raw-data-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }
.raw-line { font-family: monospace; font-size: 0.85rem; background: rgba(0,0,0,0.3); padding: 8px 12px; border-radius: 6px; border-left: 2px solid var(--accent); color: #e2e8f0; display: flex; flex-direction: column; gap: 4px; }
.raw-line .prop { color: #fdcb6e; font-weight: bold; }
.raw-line .val { color: #4ADE80; word-break: break-all; }
.raw-line.error { border-left-color: #ff7675; }
.raw-line.error .val { color: #ff7675; }
