/* RapidTagsAI SEO Checker — styles */
.rtai-wrap {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0f172a;
    border-radius: 1.5rem;
    padding: 2rem;
    color: #f8fafc;
    max-width: 860px;
    margin: 0 auto;
}

/* Input row */
.rtai-input-row {
    display: flex;
    gap: .75rem;
    margin-bottom: .75rem;
}
.rtai-input-row input {
    flex: 1;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: .75rem;
    padding: .75rem 1rem;
    color: #f8fafc;
    font-size: .95rem;
    outline: none;
    transition: border-color .2s;
}
.rtai-input-row input:focus { border-color: #3b82f6; }

.rtai-key-row input {
    width: 100%;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: .75rem;
    padding: .6rem 1rem;
    color: #94a3b8;
    font-size: .8rem;
    outline: none;
    margin-bottom: 1.25rem;
    transition: border-color .2s;
    box-sizing: border-box;
}
.rtai-key-row input:focus { border-color: #334155; }

#rtai-run-btn {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: .75rem;
    padding: .75rem 1.5rem;
    font-weight: 700;
    font-size: .9rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s;
}
#rtai-run-btn:hover { background: #2563eb; }
#rtai-run-btn:disabled { background: #334155; cursor: not-allowed; }
#rtai-run-btn svg { width: 16px; height: 16px; }

/* Status */
.rtai-status {
    padding: .75rem 1rem;
    border-radius: .75rem;
    font-size: .875rem;
    margin-bottom: 1.25rem;
}
.rtai-status.loading { background: #1e293b; color: #60a5fa; }
.rtai-status.error   { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: #f87171; }

/* Score */
.rtai-score-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: #1e293b;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.rtai-score-circle {
    position: relative;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}
.rtai-score-circle svg { width: 100px; height: 100px; }
.rtai-score-circle span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
}
.rtai-score-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #64748b; margin-bottom: .5rem; }
.rtai-summary { color: #94a3b8; font-size: .9rem; line-height: 1.6; margin: 0; }

/* Tabs */
.rtai-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.25rem;
}
.rtai-tab {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: .5rem;
    padding: .45rem .9rem;
    color: #94a3b8;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.rtai-tab:hover { border-color: #3b82f6; color: #fff; }
.rtai-tab.active { background: #3b82f6; border-color: #3b82f6; color: #fff; }

/* Panels */
.rtai-panel { display: none; }
.rtai-panel.active { display: block; }

/* Metric rows */
.rtai-metric {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: .75rem 0;
    border-bottom: 1px solid #1e293b;
    gap: 1rem;
}
.rtai-metric:last-child { border-bottom: none; }
.rtai-metric-label { font-size: .875rem; font-weight: 600; color: #e2e8f0; }
.rtai-metric-note  { font-size: .8rem; color: #64748b; margin-top: 2px; }
.rtai-badge {
    flex-shrink: 0;
    font-size: .75rem;
    font-weight: 700;
    padding: .25rem .65rem;
    border-radius: .4rem;
}
.rtai-badge.ok   { background: rgba(34,197,94,.15); color: #4ade80; }
.rtai-badge.warn { background: rgba(234,179,8,.15);  color: #fbbf24; }
.rtai-badge.bad  { background: rgba(239,68,68,.15);  color: #f87171; }

/* Issues */
.rtai-issue-list { list-style: none; padding: 0; margin: 0; }
.rtai-issue-list li {
    padding: .6rem .75rem;
    border-radius: .5rem;
    font-size: .875rem;
    margin-bottom: .4rem;
    display: flex;
    align-items: flex-start;
    gap: .5rem;
}
.rtai-issue-list li::before { flex-shrink: 0; margin-top: 2px; }
.issue-critical { background: rgba(239,68,68,.1);  color: #fca5a5; }
.issue-critical::before { content: '🔴'; }
.issue-warning  { background: rgba(234,179,8,.1);  color: #fde68a; }
.issue-warning::before  { content: '🟡'; }
.issue-notice   { background: rgba(59,130,246,.1); color: #93c5fd; }
.issue-notice::before   { content: '🔵'; }

.rtai-issue-group-title {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #475569;
    margin: 1rem 0 .5rem;
}

/* Recommendations */
.rtai-rec {
    background: #1e293b;
    border-radius: .75rem;
    padding: 1rem 1.25rem;
    margin-bottom: .75rem;
    border-left: 3px solid #3b82f6;
}
.rtai-rec-title { font-weight: 700; color: #fff; margin-bottom: .25rem; font-size: .9rem; }
.rtai-rec-detail { color: #94a3b8; font-size: .85rem; line-height: 1.5; }
.rtai-rec-impact { display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-top: .5rem; padding: .15rem .5rem; border-radius: .3rem; }
.impact-High   { background: rgba(239,68,68,.15); color: #f87171; }
.impact-Medium { background: rgba(234,179,8,.15);  color: #fbbf24; }
.impact-Low    { background: rgba(100,116,139,.2); color: #94a3b8; }

/* ── Loader ───────────────────────────────────────────────── */
.rtai-loader-wrap {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: #1e293b;
    border-radius: 1rem;
    padding: 1.75rem 2rem;
    margin-bottom: 1.25rem;
}
.rtai-loader-spinner {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
}
.rtai-loader-spinner svg {
    width: 56px;
    height: 56px;
    animation: spin .9s linear infinite;
}
.rtai-spin-arc {
    transform-origin: center;
}
.rtai-loader-content { flex: 1; }
.rtai-loader-title {
    font-weight: 700;
    color: #fff;
    font-size: 1rem;
    margin-bottom: .35rem;
}
.rtai-loader-step {
    font-size: .85rem;
    color: #60a5fa;
    margin-bottom: .85rem;
    min-height: 1.2em;
}
.rtai-loader-bar-wrap {
    background: #0f172a;
    border-radius: 1rem;
    height: 5px;
    overflow: hidden;
    margin-bottom: .5rem;
}
.rtai-loader-bar {
    height: 100%;
    border-radius: 1rem;
    background: linear-gradient(90deg, #3b82f6, #6366f1, #3b82f6);
    background-size: 200% 100%;
    animation: rtai-shimmer 1.5s linear infinite;
    width: 100%;
}
.rtai-loader-note {
    font-size: .75rem;
    color: #334155;
}
@keyframes rtai-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
@media (max-width: 600px) {
    .rtai-loader-wrap { flex-direction: column; text-align: center; gap: 1rem; }
}

/* Domain Rating Gauge */
.rtai-dr-gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #1e293b;
    border-radius: 1rem;
    padding: 1.5rem 1rem 1rem;
    margin-bottom: 1.25rem;
}
.rtai-dr-gauge-inner {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: .5rem;
}
.rtai-dr-num {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 800;
}
.rtai-dr-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #64748b;
    margin-bottom: .35rem;
}

/* Domain metrics block */
.rtai-domain-metrics { margin-bottom: 1.25rem; }

/* Section title */
.rtai-section-title {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #475569;
    margin: 1.25rem 0 .75rem;
}

/* Traffic regions */
.rtai-region-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .5rem;
}
.rtai-region-label {
    width: 150px;
    flex-shrink: 0;
    font-size: .8rem;
    color: #cbd5e1;
}
.rtai-region-bar-wrap {
    flex: 1;
    background: #1e293b;
    border-radius: .5rem;
    height: 8px;
    overflow: hidden;
}
.rtai-region-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    border-radius: .5rem;
    transition: width .8s ease;
}
.rtai-region-pct {
    width: 45px;
    text-align: right;
    font-size: .8rem;
    font-weight: 600;
    color: #94a3b8;
    flex-shrink: 0;
}

/* Traffic trend badge */
.rtai-trend-badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    padding: .15rem .5rem;
    border-radius: .35rem;
    margin-left: .35rem;
    vertical-align: middle;
}
.rtai-trend-badge.trend-up     { background: rgba(34,197,94,.15);  color: #4ade80; }
.rtai-trend-badge.trend-down   { background: rgba(239,68,68,.15);  color: #f87171; }
.rtai-trend-badge.trend-stable { background: rgba(100,116,139,.2); color: #94a3b8; }

/* Top keywords table */
.rtai-kw-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .8rem;
    margin-top: .5rem;
}
.rtai-kw-table th {
    text-align: left;
    color: #475569;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: .4rem .5rem;
    border-bottom: 1px solid #1e293b;
}
.rtai-kw-table td {
    padding: .55rem .5rem;
    border-bottom: 1px solid #1e293b;
    color: #cbd5e1;
}
.rtai-kw-table tr:last-child td { border-bottom: none; }
.rtai-kw-table td:nth-child(2) { color: #60a5fa; font-weight: 600; text-align: center; }
.rtai-kw-table td:nth-child(3) { color: #94a3b8; text-align: right; }

@media (max-width: 600px) {
    .rtai-input-row { flex-direction: column; }
    .rtai-score-row { flex-direction: column; text-align: center; }
    .rtai-region-label { width: 100px; font-size: .75rem; }
}
