/* AI Visibility Checker — Frontend CSS */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500&display=swap');

.aivc-wrap, .aivc-wrap * { box-sizing: border-box; }
.aivc-wrap button { cursor: pointer; font-family: inherit; }
.aivc-wrap h1,.aivc-wrap h2,.aivc-wrap h3,.aivc-wrap h4,.aivc-wrap p { margin: 0; }
.aivc-wrap a { text-decoration: none; }

.aivc-wrap {
    --aivc-bg:      #0a0f1e;
    --aivc-bg2:     #0f172a;
    --aivc-bg3:     #1e293b;
    --aivc-border:  rgba(255,255,255,0.08);
    --aivc-border2: rgba(255,255,255,0.14);
    --aivc-accent:  #6366f1;
    --aivc-accent2: #4f46e5;
    --aivc-green:   #10b981;
    --aivc-yellow:  #f59e0b;
    --aivc-red:     #ef4444;
    --aivc-text:    #e2e8f0;
    --aivc-muted:   #94a3b8;
    --aivc-r:       12px;

    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--aivc-bg);
    color: var(--aivc-text);
    max-width: 1100px;
    margin: 2rem auto;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.aivc-wrap::before {
    content: '';
    position: absolute; top: -200px; left: 50%; transform: translateX(-50%);
    width: 800px; height: 500px;
    background: radial-gradient(ellipse, rgba(99,102,241,0.15) 0%, transparent 70%);
    pointer-events: none; z-index: 0;
}

/* ── Hero ── */
.aivc-hero {
    text-align: center; padding: 3.5rem 2rem 2.5rem;
    position: relative; z-index: 1;
}
.aivc-hero__badge {
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.3);
    color: #a5b4fc; font-size: 0.72rem; font-weight: 700;
    letter-spacing: 0.1em; padding: 5px 14px; border-radius: 100px; margin-bottom: 1.25rem;
}
.aivc-dot { width: 7px; height: 7px; background: var(--aivc-accent); border-radius: 50%; animation: aivc-pulse 2s ease-in-out infinite; }
@keyframes aivc-pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(1.3)} }
.aivc-hero__title { font-size: clamp(1.8rem,3.5vw,2.8rem); font-weight: 800; color: #fff; line-height: 1.2; margin-bottom: 1rem; }
.aivc-gradient { background: linear-gradient(135deg, var(--aivc-accent), #818cf8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.aivc-hero__sub { font-size: 1rem; color: var(--aivc-muted); max-width: 520px; line-height: 1.65; }
.aivc-stats { display: inline-flex; align-items: center; background: var(--aivc-bg2); border: 1px solid var(--aivc-border2); border-radius: 100px; padding: 8px 0; margin-top: 1.75rem; }
.aivc-stat { padding: 0 1.25rem; text-align: center; }
.aivc-stat span { display: block; font-size: 1.1rem; font-weight: 800; color: #fff; line-height: 1; }
.aivc-stat small { display: block; font-size: 0.68rem; color: var(--aivc-muted); margin-top: 2px; }
.aivc-stat-sep { width: 1px; height: 32px; background: var(--aivc-border2); }

/* ── Cards ── */
.aivc-card {
    background: var(--aivc-bg2); border: 1px solid var(--aivc-border);
    border-radius: var(--aivc-r); padding: 1.75rem;
    margin: 0 2rem 1.25rem; position: relative; overflow: hidden;
}
.aivc-card--main { border-color: rgba(99,102,241,0.25); background: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, rgba(79,70,229,0.04) 100%); position: relative; z-index: 1; }
.aivc-card--score { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 2rem 1.5rem; background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(79,70,229,0.07)); border-color: rgba(99,102,241,0.25); }
.aivc-card--ai { border-color: rgba(99,102,241,0.35); background: linear-gradient(135deg, rgba(99,102,241,0.1) 0%, rgba(79,70,229,0.06) 100%); box-shadow: 0 0 40px rgba(99,102,241,0.12); }
.aivc-card__glow { position: absolute; top: -80px; left: 50%; transform: translateX(-50%); width: 400px; height: 250px; background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%); pointer-events: none; animation: aivc-glow 4s ease-in-out infinite; }
@keyframes aivc-glow { 0%,100%{opacity:.5} 50%{opacity:1} }
.aivc-card__head { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; }
.aivc-card__head h3 { font-size: 1.05rem; font-weight: 800; color: #fff; margin-bottom: 3px; }
.aivc-card__head p { font-size: 0.83rem; color: var(--aivc-muted); }
.aivc-card__head-icon { width: 44px; height: 44px; flex-shrink: 0; background: rgba(99,102,241,0.15); border: 1px solid rgba(99,102,241,0.3); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--aivc-accent); font-size: 1.1rem; }

/* ── Form ── */
.aivc-form { position: relative; z-index: 1; }
.aivc-form__row { display: flex; gap: 0.75rem; margin-bottom: 0.75rem; }
.aivc-form__row--second { align-items: stretch; }
.aivc-input-wrap { position: relative; flex: 1; }
.aivc-input-wrap--url { flex: 1.4; }
.aivc-input-icon { display: none; }
.aivc-input {
    width: 100%; padding: 1rem 1rem !important;
    background: rgba(255,255,255,0.96) !important; border: 2px solid rgba(99,102,241,0.2) !important;
    border-radius: var(--aivc-r) !important; color: #1a1a2e !important;
    font-size: 0.95rem !important; font-family: inherit !important;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.aivc-input:focus { outline: none !important; border-color: var(--aivc-accent) !important; box-shadow: 0 0 0 4px rgba(99,102,241,0.15) !important; }
.aivc-input::placeholder { color: #94a3b8 !important; }
.aivc-btn-primary {
    padding: 1rem 1.75rem; background: linear-gradient(135deg, var(--aivc-accent), var(--aivc-accent2));
    border: none; border-radius: var(--aivc-r); color: #fff; font-size: 0.95rem; font-weight: 700;
    display: inline-flex; align-items: center; gap: 0.6rem; white-space: nowrap;
    transition: transform 0.2s, box-shadow 0.2s; box-shadow: 0 6px 20px rgba(99,102,241,0.4);
}
.aivc-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(99,102,241,0.5); color: #fff; }
.aivc-btn-primary:disabled { opacity: 0.5; transform: none; cursor: not-allowed; }
.aivc-btn-ghost { background: rgba(255,255,255,0.06); border: 1px solid var(--aivc-border2); border-radius: 8px; color: var(--aivc-muted); font-size: 0.82rem; font-weight: 600; padding: 0.5rem 1rem; display: inline-flex; align-items: center; gap: 0.4rem; transition: all 0.2s; }
.aivc-btn-ghost:hover { background: rgba(255,255,255,0.1); color: #fff; }
.aivc-form__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.aivc-tag { display: inline-flex; align-items: center; gap: 5px; background: rgba(255,255,255,0.05); border: 1px solid var(--aivc-border); border-radius: 100px; color: var(--aivc-muted); font-size: 0.75rem; font-weight: 600; padding: 4px 11px; }
.aivc-tag i { color: var(--aivc-accent); font-size: 0.7rem; }

/* ── Loading ── */
.aivc-loading { margin: 0 2rem 1.5rem; }
.aivc-loading__inner { background: var(--aivc-bg2); border: 1px solid var(--aivc-border); border-radius: var(--aivc-r); padding: 3rem 2rem; text-align: center; }
.aivc-loader { position: relative; width: 80px; height: 80px; margin: 0 auto 1.75rem; }
.aivc-loader__ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--aivc-accent); animation: aivc-spin 1s linear infinite; }
.aivc-loader__ring--2 { inset: 10px; border-top-color: #818cf8; animation-duration: 0.7s; animation-direction: reverse; }
.aivc-loader__dot { position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(135deg, var(--aivc-accent), var(--aivc-accent2)); animation: aivc-dot 1s ease-in-out infinite; }
@keyframes aivc-spin { to { transform: rotate(360deg); } }
@keyframes aivc-dot { 0%,100%{transform:scale(1)} 50%{transform:scale(1.3)} }
.aivc-loading__title { font-size: 1.15rem; font-weight: 700; color: #fff; margin-bottom: 0.4rem; }
.aivc-loading__sub { font-size: 0.88rem; color: var(--aivc-muted); margin-bottom: 1.25rem; }
.aivc-progress { background: rgba(255,255,255,0.06); border-radius: 100px; height: 6px; max-width: 320px; margin: 0 auto 1.5rem; overflow: hidden; }
.aivc-progress__bar { height: 100%; border-radius: 100px; background: linear-gradient(90deg, var(--aivc-accent), #818cf8); transition: width 0.5s ease; width: 0%; }
.aivc-loading__steps { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; }
.aivc-step { font-size: 0.78rem; color: var(--aivc-muted); display: flex; align-items: center; gap: 0.4rem; transition: color 0.3s; }
.aivc-step.active { color: var(--aivc-accent); font-weight: 700; }
.aivc-step.done { color: var(--aivc-green); }

/* ── Results header ── */
.aivc-results-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.25rem 2rem; border-bottom: 1px solid var(--aivc-border);
    margin-bottom: 1.25rem; flex-wrap: wrap; gap: 0.75rem;
}

/* ── Top row ── */
.aivc-top-row { display: grid; grid-template-columns: 240px 1fr; gap: 1.25rem; margin: 0 2rem 1.25rem; }
.aivc-score-ring { position: relative; width: 160px; height: 160px; margin: 0 auto 1rem; }
.aivc-score-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.aivc-score-num { font-size: 2.8rem; font-weight: 800; color: #fff; line-height: 1; }
.aivc-score-sub { font-size: 0.78rem; color: var(--aivc-muted); }
.aivc-score-label { font-size: 1rem; font-weight: 700; color: #fff; margin-bottom: 0.3rem; }
.aivc-score-desc { font-size: 0.8rem; color: var(--aivc-muted); }

/* Quick grid */
.aivc-quick-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 0.75rem; align-content: start; }
.aivc-quick { background: var(--aivc-bg2); border: 1px solid var(--aivc-border); border-radius: var(--aivc-r); padding: 0.9rem; display: flex; align-items: center; gap: 0.7rem; }
.aivc-quick__icon { font-size: 1.1rem; color: var(--aivc-accent); flex-shrink: 0; }
.aivc-quick__val { font-size: 0.95rem; font-weight: 700; color: #fff; }
.aivc-quick__lbl { font-size: 0.7rem; color: var(--aivc-muted); }
.aivc-quick__badge { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.62rem; font-weight: 700; flex-shrink: 0; }
.aivc-quick__badge.ok   { background: rgba(16,185,129,0.15); color: var(--aivc-green); }
.aivc-quick__badge.warn { background: rgba(245,158,11,0.15); color: var(--aivc-yellow); }
.aivc-quick__badge.bad  { background: rgba(239,68,68,0.15); color: var(--aivc-red); }

/* ── AI Output ── */
.aivc-ai-output { font-size: 0.88rem; line-height: 1.8; color: var(--aivc-text); }
.aivc-ai-output strong { color: #fff; }
.aivc-ai-output p { margin: 0.5rem 0; }
.aivc-loading-small { display: flex; align-items: center; gap: 0.75rem; font-size: 0.88rem; color: var(--aivc-muted); padding: 0.75rem 0; }
.aivc-spinner-sm { width: 20px; height: 20px; border: 2px solid var(--aivc-border2); border-top-color: var(--aivc-accent); border-radius: 50%; animation: aivc-spin 0.8s linear infinite; flex-shrink: 0; }

/* ── Platform results ── */
.aivc-platform-group { margin-bottom: 1.5rem; }
.aivc-platform-title { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; font-weight: 700; color: #fff; margin-bottom: 0.75rem; }
.aivc-result-item { background: var(--aivc-bg3); border: 1px solid var(--aivc-border); border-radius: 8px; padding: 1rem; margin-bottom: 0.6rem; }
.aivc-result-item__head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; flex-wrap: wrap; }
.aivc-result-item__prompt { font-size: 0.85rem; font-weight: 600; color: #fff; margin-bottom: 0.4rem; }
.aivc-result-item__response { font-size: 0.8rem; color: var(--aivc-muted); line-height: 1.65; background: rgba(0,0,0,0.2); border-radius: 6px; padding: 0.65rem; max-height: 130px; overflow-y: auto; white-space: pre-wrap; }
.aivc-result-item__response.expanded { max-height: none; }
.aivc-expand { background: rgba(255,255,255,0.06); border: 1px solid var(--aivc-border); border-radius: 6px; color: var(--aivc-muted); font-size: 0.72rem; padding: 3px 10px; margin-top: 0.4rem; transition: all 0.2s; }
.aivc-expand:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* ── Pills ── */
.aivc-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 100px; font-size: 0.72rem; font-weight: 700; }
.aivc-pill--ok   { background: rgba(16,185,129,0.12); color: #34d399; border: 1px solid rgba(16,185,129,0.25); }
.aivc-pill--warn { background: rgba(245,158,11,0.12); color: #fcd34d; border: 1px solid rgba(245,158,11,0.25); }
.aivc-pill--bad  { background: rgba(239,68,68,0.1);  color: #fca5a5; border: 1px solid rgba(239,68,68,0.2); }
.aivc-pill--info { background: rgba(99,102,241,0.1); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.25); }

/* ── Recommendations ── */
.aivc-rec { display: flex; gap: 0.85rem; align-items: flex-start; padding: 0.85rem 1rem; border-radius: 8px; border: 1px solid; margin-bottom: 0.5rem; }
.aivc-rec--error  { background: rgba(239,68,68,0.06); border-color: rgba(239,68,68,0.2); }
.aivc-rec--warn   { background: rgba(245,158,11,0.06); border-color: rgba(245,158,11,0.2); }
.aivc-rec--info   { background: rgba(59,130,246,0.06); border-color: rgba(59,130,246,0.15); }
.aivc-rec--tip    { background: rgba(99,102,241,0.06); border-color: rgba(99,102,241,0.2); }
.aivc-rec__icon { width: 28px; height: 28px; border-radius: 6px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 0.78rem; }
.aivc-rec--error .aivc-rec__icon { background: rgba(239,68,68,0.15); color: #fca5a5; }
.aivc-rec--warn  .aivc-rec__icon { background: rgba(245,158,11,0.15); color: #fcd34d; }
.aivc-rec--info  .aivc-rec__icon { background: rgba(59,130,246,0.12); color: #93c5fd; }
.aivc-rec--tip   .aivc-rec__icon { background: rgba(99,102,241,0.12); color: #a5b4fc; }
.aivc-rec__cat { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 2px; }
.aivc-rec--error .aivc-rec__cat { color: #fca5a5; }
.aivc-rec--warn  .aivc-rec__cat { color: #fcd34d; }
.aivc-rec--info  .aivc-rec__cat { color: #93c5fd; }
.aivc-rec--tip   .aivc-rec__cat { color: #a5b4fc; }
.aivc-rec__msg    { font-size: 0.85rem; color: var(--aivc-text); }
.aivc-rec__action { font-size: 0.75rem; color: var(--aivc-muted); margin-top: 3px; }

/* ── Audit checks ── */
.aivc-check { display: flex; align-items: flex-start; gap: 0.85rem; padding: 0.85rem; border-radius: 8px; border: 1px solid var(--aivc-border); background: var(--aivc-bg3); margin-bottom: 0.5rem; }
.aivc-check--ok      { border-color: rgba(16,185,129,0.15); }
.aivc-check--warning { border-color: rgba(245,158,11,0.15); }
.aivc-check--error   { border-color: rgba(239,68,68,0.15); }
.aivc-check__icon { width: 30px; height: 30px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 0.82rem; flex-shrink: 0; }
.aivc-check--ok      .aivc-check__icon { background: rgba(16,185,129,0.15); color: #34d399; }
.aivc-check--warning .aivc-check__icon { background: rgba(245,158,11,0.15); color: #fcd34d; }
.aivc-check--error   .aivc-check__icon { background: rgba(239,68,68,0.12); color: #fca5a5; }
.aivc-check__title  { font-size: 0.85rem; font-weight: 700; color: #fff; margin-bottom: 2px; }
.aivc-check__msg    { font-size: 0.78rem; color: var(--aivc-muted); }
.aivc-check__detail { font-size: 0.75rem; color: var(--aivc-yellow); margin-top: 4px; }
.aivc-check__pts    { margin-left: auto; font-size: 0.75rem; font-weight: 700; color: var(--aivc-accent); white-space: nowrap; }

/* ── Features ── */
.aivc-features { padding: 3rem 2rem; border-top: 1px solid var(--aivc-border); }
.aivc-feat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 1rem; }
.aivc-feat { background: var(--aivc-bg2); border: 1px solid var(--aivc-border); border-radius: var(--aivc-r); padding: 1.25rem; }
.aivc-feat__icon { width: 40px; height: 40px; background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.25); border-radius: 9px; display: flex; align-items: center; justify-content: center; color: var(--aivc-accent); font-size: 1rem; margin-bottom: 0.85rem; }
.aivc-feat h4 { font-size: 0.9rem; font-weight: 700; color: #fff; margin-bottom: 0.35rem; }
.aivc-feat p { font-size: 0.78rem; color: var(--aivc-muted); line-height: 1.5; }

/* ── Responsive ── */
@media (max-width: 860px) {
    .aivc-top-row { grid-template-columns: 1fr; }
    .aivc-card--score { flex-direction: row; gap: 1.5rem; text-align: left; }
    .aivc-score-ring { width: 120px; height: 120px; flex-shrink: 0; margin: 0; }
}
@media (max-width: 640px) {
    .aivc-hero { padding: 2.5rem 1.25rem 2rem; }
    .aivc-card, .aivc-top-row, .aivc-results-header { margin-left: 1rem; margin-right: 1rem; }
    .aivc-form__row { flex-direction: column; }
    .aivc-btn-primary { justify-content: center; }
    .aivc-quick-grid { grid-template-columns: repeat(2,1fr); }
    .aivc-stats { flex-direction: column; border-radius: 12px; }
    .aivc-stat-sep { width: 100%; height: 1px; }
    .aivc-features { padding: 2rem 1rem; }
}

/* Fade in */
#aivcResults .aivc-card, #aivcResults .aivc-top-row, #aivcResults .aivc-results-header { animation: aivc-fadein 0.4s ease both; }
@keyframes aivc-fadein { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
