/* ============================================================
   LLMRanky — Component Styles
   Source: DESIGN_SYSTEM.md §6
   Buttons · Cards · Inputs · Badges · Score · Alerts
   ============================================================ */

/* ── Buttons (§6.1) ─────────────────────────────────────────── */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
    padding: 0.625rem 1.25rem; font-size: var(--text-sm); font-weight: 500; line-height: 1;
    border-radius: var(--radius-md); border: 1px solid transparent;
    cursor: pointer; transition: all var(--transition-fast); text-decoration: none; white-space: nowrap;
    font-family: var(--font-sans);
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; pointer-events: none; }

.btn-primary { background: var(--color-primary); color: var(--color-text-inverse); }
.btn-primary:hover { background: var(--color-primary-hover); box-shadow: var(--shadow-md); transform: translateY(-1px); }

.btn-secondary { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn-secondary:hover { background: var(--color-primary-bg); }

.btn-ghost { background: transparent; color: var(--color-text-secondary); }
.btn-ghost:hover { background: var(--color-surface-hover); color: var(--color-text); }

.btn-muted { background: var(--color-surface-hover); color: var(--color-text-muted); border-color: var(--color-border); }
.btn-muted:hover { background: var(--color-surface); color: var(--color-primary); border-color: var(--color-primary); }

.btn-cta {
    background: var(--gradient-cta); color: var(--color-text-inverse);
    font-weight: 600; padding: 0.75rem 1.5rem; font-size: var(--text-base);
    border-radius: var(--radius-lg);
}
.btn-cta:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.btn-danger { background: var(--color-critical); color: var(--color-text-inverse); }
.btn-danger:hover { background: #DC2626; box-shadow: var(--shadow-md); }

.btn-sm { padding: 0.375rem 0.75rem; font-size: var(--text-xs); }
.btn-lg { padding: 0.875rem 1.75rem; font-size: var(--text-base); }
.btn-block { width: 100%; }

.btn-loading { position: relative; color: transparent !important; }
.btn-loading::after {
    content: ''; position: absolute; width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ── Cards (§6.2) ───────────────────────────────────────────── */

.card {
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius-lg); padding: var(--space-6);
    box-shadow: var(--shadow-sm); transition: all var(--transition-base);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-static:hover { box-shadow: var(--shadow-sm); transform: none; }

.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4); }
.card-title { font-size: var(--text-lg); font-weight: 600; }
.card-subtitle { font-size: var(--text-sm); color: var(--color-text-secondary); }

.card-glass {
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.3);
}

.card-highlight {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md), 0 0 0 1px var(--color-primary);
}

/* ── Form Inputs (§6.3) ─────────────────────────────────────── */

.form-group { margin-bottom: var(--space-5); }
.form-label { display: block; font-size: var(--text-sm); font-weight: 500; margin-bottom: var(--space-2); color: var(--color-text); }
.form-hint { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: var(--space-1); }

.form-input {
    width: 100%; padding: 0.625rem 0.875rem; font-size: var(--text-base);
    border: 1px solid var(--color-border); border-radius: var(--radius-sm);
    transition: all var(--transition-fast); outline: none; background: var(--color-surface);
    font-family: var(--font-sans); color: var(--color-text);
}
.form-input::placeholder { color: var(--color-text-placeholder); }
.form-input:hover { border-color: var(--color-border-strong); }
.form-input:focus { border-color: var(--color-primary); box-shadow: var(--ring-primary); }
.form-input.error { border-color: var(--color-critical); }
.form-input.error:focus { box-shadow: var(--ring-error); }

.form-error { font-size: var(--text-sm); color: var(--color-critical); margin-top: var(--space-1); display: none; }
.form-error.visible { display: block; }

.form-password-wrap { position: relative; }
.form-password-toggle {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; color: var(--color-text-muted);
    padding: var(--space-1); display: flex; align-items: center;
}
.form-password-toggle:hover { color: var(--color-text); }

.search-input-hero {
    display: flex; align-items: center;
    background: var(--color-surface); border: 2px solid var(--color-border);
    border-radius: var(--radius-xl); padding: 0.5rem 0.5rem 0.5rem 1.25rem;
    box-shadow: var(--shadow-lg); max-width: 600px; width: 100%;
    transition: all var(--transition-fast);
}
.search-input-hero:focus-within { border-color: var(--color-primary); box-shadow: var(--shadow-xl), var(--ring-primary); }
.search-input-hero input {
    flex: 1; border: none; outline: none; font-size: var(--text-lg);
    background: transparent; color: var(--color-text); font-family: var(--font-sans);
    min-width: 0;
}
.search-input-hero input::placeholder { color: var(--color-text-placeholder); }
.search-input-hero .btn { flex-shrink: 0; }

/* ── Badges & Pills (§6.4) ──────────────────────────────────── */

.badge {
    display: inline-flex; align-items: center;
    padding: 0.125rem 0.5rem; font-size: var(--text-xs); font-weight: 500;
    border-radius: var(--radius-full);
}

.badge-excellent { background: var(--color-excellent-bg); color: var(--color-excellent); border: 1px solid var(--color-excellent-border); }
.badge-good { background: var(--color-good-bg); color: var(--color-good); border: 1px solid var(--color-good-border); }
.badge-risky { background: var(--color-risky-bg); color: var(--color-risky); border: 1px solid var(--color-risky-border); }
.badge-critical { background: var(--color-critical-bg); color: var(--color-critical); border: 1px solid var(--color-critical-border); }
.badge-muted { background: var(--color-surface-hover); color: var(--color-text-muted); border: 1px solid var(--color-border); }
.badge-primary { background: var(--color-primary-bg); color: var(--color-primary); border: 1px solid var(--color-primary-light); }
.badge-competitor { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; font-weight: 700; cursor: help; }
.badge-plan-lock { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; font-size: 11px; }

.pill {
    display: inline-flex; align-items: center; padding: 0.375rem 0.875rem;
    font-size: var(--text-sm); font-weight: 500; border-radius: var(--radius-full);
    border: 1px solid var(--color-border); background: var(--color-surface);
    color: var(--color-text-secondary); cursor: pointer; transition: all var(--transition-fast);
}
.pill:hover, .pill.active { background: var(--color-primary-bg); border-color: var(--color-primary); color: var(--color-primary); }

/* ── Score Display (§6.5) ───────────────────────────────────── */

.score-ring {
    position: relative; width: 120px; height: 120px; display: flex;
    align-items: center; justify-content: center; flex-direction: column;
}
.score-ring svg { position: absolute; top: 0; left: 0; transform: rotate(-90deg); }
.score-ring-value { font-size: var(--text-3xl); font-weight: 700; line-height: 1; }
.score-ring-label { font-size: var(--text-xs); color: var(--color-text-muted); }

.score-ring-lg { width: 160px; height: 160px; }
.score-ring-lg .score-ring-value { font-size: var(--text-4xl); }

/* ── Alerts ─────────────────────────────────────────────────── */

.alert {
    padding: var(--space-4); border-radius: var(--radius-md);
    font-size: var(--text-sm); display: flex; align-items: flex-start; gap: var(--space-3);
}
.alert-success { background: var(--color-excellent-bg); color: #065F46; border: 1px solid var(--color-excellent-border); }
.alert-error { background: var(--color-critical-bg); color: #991B1B; border: 1px solid var(--color-critical-border); }
.alert-warning { background: var(--color-good-bg); color: #92400E; border: 1px solid var(--color-good-border); }
.alert-info { background: var(--color-primary-bg); color: #1E40AF; border: 1px solid var(--color-primary-light); }

/* ── Progress Bar ───────────────────────────────────────────── */

.progress-bar { width: 100%; height: 8px; background: var(--color-surface-hover); border-radius: var(--radius-full); overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--gradient-primary); border-radius: var(--radius-full); transition: width 0.5s ease; }

.progress-steps { display: flex; justify-content: space-between; margin-top: var(--space-3); }
.progress-step { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); flex: 1; }
.progress-step-dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--color-border); background: var(--color-surface); display: flex; align-items: center; justify-content: center; font-size: var(--text-xs); font-weight: 600; transition: all var(--transition-base); }
.progress-step.active .progress-step-dot { border-color: var(--color-primary); background: var(--color-primary); color: var(--color-text-inverse); }
.progress-step.done .progress-step-dot { border-color: var(--color-excellent); background: var(--color-excellent); color: var(--color-text-inverse); }
.progress-step-label { font-size: var(--text-xs); color: var(--color-text-muted); text-align: center; }
.progress-step.active .progress-step-label { color: var(--color-primary); font-weight: 500; }

/* ── Empty State ────────────────────────────────────────────── */

.empty-state { text-align: center; padding: var(--space-16) var(--space-4); }
.empty-state-icon { font-size: 3rem; margin-bottom: var(--space-4); opacity: 0.5; }
.empty-state-title { font-size: var(--text-xl); font-weight: 600; margin-bottom: var(--space-2); }
.empty-state-text { color: var(--color-text-secondary); margin-bottom: var(--space-6); max-width: 400px; margin-left: auto; margin-right: auto; }

/* ── Locked Overlay (freemium blur) ─────────────────────────── */

.locked-overlay { position: relative; }
.locked-overlay .locked-content { filter: blur(5px); pointer-events: none; user-select: none; }
.locked-overlay .locked-badge {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
    z-index: 2; text-align: center;
}
.locked-icon { font-size: 1.5rem; }
.locked-cta { font-size: var(--text-sm); font-weight: 500; color: var(--color-primary); }

/* ── Tabs ───────────────────────────────────────────────────── */

.tabs { display: flex; border-bottom: 1px solid var(--color-border); gap: 0; margin-bottom: var(--space-6); overflow-x: auto; }
.tab {
    padding: var(--space-3) var(--space-4); font-size: var(--text-sm); font-weight: 500;
    color: var(--color-text-muted); border-bottom: 2px solid transparent; cursor: pointer;
    transition: all var(--transition-fast); white-space: nowrap; background: none; border-top: none; border-left: none; border-right: none;
}
.tab:hover { color: var(--color-text); }
.tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Toast Notifications ────────────────────────────────────── */

.toast-container { position: fixed; top: 80px; right: var(--space-4); z-index: 1000; display: flex; flex-direction: column; gap: var(--space-2); }
.toast {
    padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg); font-size: var(--text-sm); font-weight: 500;
    display: flex; align-items: center; gap: var(--space-2); min-width: 280px;
    animation: toast-in 0.3s ease;
}
.toast-success { background: var(--color-excellent); color: var(--color-text-inverse); }
.toast-error { background: var(--color-critical); color: var(--color-text-inverse); }
.toast-info { background: var(--color-primary); color: var(--color-text-inverse); }

@keyframes toast-in { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast-out { animation: toast-out 0.3s ease forwards; }
@keyframes toast-out { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }

/* ── Live Log (scan real-time feed) ──────────────────────────── */

.live-log {
    background: #0f1117;
    border: 1px solid #2a2d3a;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: var(--space-4);
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 12.5px;
    line-height: 1.7;
}

.live-log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-4);
    background: #181a24;
    border-bottom: 1px solid #2a2d3a;
}

.live-log-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: #8b8fa3;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.live-log-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    animation: log-pulse 2s ease-in-out infinite;
}

.live-log-dot.idle { background: #6b7280; animation: none; }

@keyframes log-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.live-log-count {
    color: #6b7280;
    font-size: 11px;
}

.live-log-body {
    max-height: 280px;
    overflow-y: auto;
    padding: var(--space-3) var(--space-4);
    scrollbar-width: thin;
    scrollbar-color: #2a2d3a #0f1117;
}

.live-log-body::-webkit-scrollbar { width: 6px; }
.live-log-body::-webkit-scrollbar-track { background: #0f1117; }
.live-log-body::-webkit-scrollbar-thumb { background: #2a2d3a; border-radius: 3px; }
.live-log-body::-webkit-scrollbar-thumb:hover { background: #3a3d4a; }

.live-log-empty {
    color: #4b5060;
    text-align: center;
    padding: var(--space-4);
    font-style: italic;
}

.log-line {
    display: flex;
    gap: var(--space-2);
    padding: 1px 0;
    animation: log-appear 0.25s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes log-appear {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.log-line-time {
    color: #4b5060;
    flex-shrink: 0;
    min-width: 58px;
}

.log-line-icon {
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

.log-line-msg {
    overflow: hidden;
    text-overflow: ellipsis;
}

.log-type-start  .log-line-icon { color: #3b82f6; }
.log-type-start  .log-line-msg  { color: #93c5fd; }
.log-type-info   .log-line-icon { color: #6b7280; }
.log-type-info   .log-line-msg  { color: #9ca3af; }
.log-type-fetch  .log-line-icon { color: #818cf8; }
.log-type-fetch  .log-line-msg  { color: #a5b4fc; }
.log-type-success .log-line-icon { color: #10b981; }
.log-type-success .log-line-msg  { color: #6ee7b7; }
.log-type-warning .log-line-icon { color: #f59e0b; }
.log-type-warning .log-line-msg  { color: #fcd34d; }
.log-type-error  .log-line-icon { color: #ef4444; }
.log-type-error  .log-line-msg  { color: #fca5a5; }
.log-type-skip   .log-line-icon { color: #6b7280; }
.log-type-skip   .log-line-msg  { color: #6b7280; font-style: italic; }
.log-type-ai     .log-line-icon { color: #a78bfa; }
.log-type-ai     .log-line-msg  { color: #c4b5fd; }
.log-type-milestone .log-line-icon { color: #f59e0b; }
.log-type-milestone .log-line-msg  { color: #fbbf24; font-weight: 600; }
.log-type-question .log-line-icon { color: #06b6d4; }
.log-type-question .log-line-msg  { color: #67e8f9; }
.log-type-done   .log-line-icon { color: #10b981; }
.log-type-done   .log-line-msg  { color: #34d399; font-weight: 700; }

@media (max-width: 639px) {
    .live-log-body { max-height: 220px; }
    .log-line { font-size: 11px; }
    .log-line-time { display: none; }
}


/* ============================================================
   EXTENDED VISUAL COMPONENTS & ANIMATIONS
   Scan Discovery · Brand Reveal · Keyword Chips · Competitor
   Cards · Question Reveal · Celebration · Score Ring · Tooltips
   AI Visibility · Glass Cards · Stagger · Analysis Progress
   Enhanced Progress · Particles/Shimmer
   ============================================================ */


/* ── 1. SCAN DISCOVERY VISUAL PANELS ──────────────────────── */

.scan-discovery {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    margin-top: var(--space-6);
}

.scan-phase {
    opacity: 0;
    transform: translateY(24px);
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                max-height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 0;
}

.scan-phase.active {
    opacity: 1;
    transform: translateY(0);
    max-height: 2000px;
    overflow: visible;
    padding: var(--space-6);
    margin-top: var(--space-4);
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.scan-phase-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    position: relative;
    padding-bottom: var(--space-3);
}

.scan-phase-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    animation: expandLine 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.scan-phase-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--color-primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
    flex-shrink: 0;
    box-shadow: 0 0 16px rgba(37, 99, 235, 0.15);
}

.scan-phase-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-text);
}

.scan-phase-subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.scan-phase-body {
    animation: fadeInUp 0.4s ease 0.2s both;
}


/* ── 2. BRAND REVEAL ─────────────────────────────────────── */

.brand-reveal {
    background: var(--color-surface);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    text-align: center;
    position: relative;
    background-clip: padding-box;
}

.brand-reveal::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius-lg) + 2px);
    background: var(--gradient-primary);
    z-index: -1;
    opacity: 0.6;
    animation: pulseGlow 3s ease-in-out infinite;
}

.brand-name-text {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
    display: inline-block;
    border-right: 3px solid var(--color-primary);
    padding-right: var(--space-2);
    animation: blinkCursor 0.8s step-end infinite;
    overflow: hidden;
    white-space: nowrap;
}

.brand-name-text.typed {
    animation: typeWriter 0.8s steps(20, end) both,
               blinkCursor 0.8s step-end infinite;
}

@media (min-width: 768px) {
    .brand-name-text { font-size: var(--text-4xl); }
}

.brand-reveal-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-4);
    flex-wrap: wrap;
}

.sector-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: var(--radius-full);
    background: var(--color-secondary-bg);
    color: var(--color-secondary);
    border: 1px solid var(--color-secondary-light);
    animation: pulseGlow 2.5s ease-in-out infinite;
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.15);
}


/* ── 2b. IDENTITY SCAN ANIMATION ─────────────────────────── */

.identity-scan-anim {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-6) var(--space-4);
    gap: var(--space-4);
}

.identity-scan-visual {
    width: 120px;
    height: 120px;
    position: relative;
}

.identity-scan-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.id-ring {
    stroke: var(--color-primary);
    opacity: 0.12;
}
.id-ring-1 { animation: idRingPulse 3s ease-in-out infinite; }
.id-ring-2 { animation: idRingPulse 3s ease-in-out 0.5s infinite; }
.id-ring-3 { animation: idRingPulse 3s ease-in-out 1s infinite; }

.id-sweep {
    stroke: var(--color-primary);
    opacity: 0.5;
    transform-origin: 100px 100px;
    animation: idSweep 2.4s linear infinite;
}

.id-core {
    fill: var(--color-primary);
    animation: idCorePulse 1.5s ease-in-out infinite;
}

.id-dot {
    fill: var(--color-primary);
    opacity: 0;
}
.id-dot-1 { animation: idDotPing 2.4s ease 0.3s infinite; }
.id-dot-2 { animation: idDotPing 2.4s ease 0.9s infinite; }
.id-dot-3 { animation: idDotPing 2.4s ease 1.5s infinite; }
.id-dot-4 { animation: idDotPing 2.4s ease 2.0s infinite; }

.identity-scan-text {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-primary);
}

.identity-scan-dots span {
    animation: idDotsWave 1.4s ease-in-out infinite;
    display: inline-block;
}
.identity-scan-dots span:nth-child(2) { animation-delay: 0.2s; }
.identity-scan-dots span:nth-child(3) { animation-delay: 0.4s; }

.identity-scan-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 260px;
}
.identity-scan-line {
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--color-border);
    overflow: hidden;
    position: relative;
}
.identity-scan-line.short { width: 60%; margin: 0 auto; }

.identity-scan-line span {
    display: block;
    height: 100%;
    width: 40%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, transparent, var(--color-primary-bg), transparent);
    animation: idLineSweep 1.8s ease-in-out infinite;
}
.identity-scan-line:nth-child(2) span { animation-delay: 0.3s; }
.identity-scan-line:nth-child(3) span { animation-delay: 0.6s; }

@keyframes idSweep {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes idRingPulse {
    0%, 100% { opacity: 0.10; stroke-width: 1; }
    50%      { opacity: 0.28; stroke-width: 1.6; }
}
@keyframes idCorePulse {
    0%, 100% { r: 5; opacity: 0.7; }
    50%      { r: 7; opacity: 1; }
}
@keyframes idDotPing {
    0%, 60%, 100% { opacity: 0; r: 2; }
    30%           { opacity: 0.8; r: 4; }
}
@keyframes idDotsWave {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30%           { opacity: 1;   transform: translateY(-3px); }
}
@keyframes idLineSweep {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

/* ── 3. KEYWORD CHIPS (Tags Cloud) ───────────────────────── */

.keyword-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: center;
}

.keyword-chip {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-primary-bg) 0%, var(--color-primary-light) 100%);
    color: var(--color-primary);
    border: 1px solid var(--color-primary-light);
    opacity: 0;
    transform: scale(0.3);
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    cursor: default;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.keyword-chip:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.keyword-chip:nth-child(even) {
    background: linear-gradient(135deg, var(--color-secondary-bg) 0%, var(--color-secondary-light) 100%);
    color: var(--color-secondary);
    border-color: var(--color-secondary-light);
}

.keyword-chip:nth-child(even):hover {
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

.keyword-chip:nth-child(1)  { animation-delay: 0.05s; }
.keyword-chip:nth-child(2)  { animation-delay: 0.1s; }
.keyword-chip:nth-child(3)  { animation-delay: 0.15s; }
.keyword-chip:nth-child(4)  { animation-delay: 0.2s; }
.keyword-chip:nth-child(5)  { animation-delay: 0.25s; }
.keyword-chip:nth-child(6)  { animation-delay: 0.3s; }
.keyword-chip:nth-child(7)  { animation-delay: 0.35s; }
.keyword-chip:nth-child(8)  { animation-delay: 0.4s; }
.keyword-chip:nth-child(9)  { animation-delay: 0.45s; }
.keyword-chip:nth-child(10) { animation-delay: 0.5s; }
.keyword-chip:nth-child(n+11) { animation-delay: 0.55s; }


/* ── 4. COMPETITOR CARDS ─────────────────────────────────── */

.competitor-cards {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.competitor-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    opacity: 0;
    transform: translateX(30px);
    animation: fadeInRight 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.competitor-card:hover {
    transform: translateX(0) translateY(-2px);
    box-shadow: var(--shadow-md);
}

.competitor-card:nth-child(1) { animation-delay: 0.1s; }
.competitor-card:nth-child(2) { animation-delay: 0.2s; }
.competitor-card:nth-child(3) { animation-delay: 0.3s; }
.competitor-card:nth-child(4) { animation-delay: 0.4s; }
.competitor-card:nth-child(5) { animation-delay: 0.5s; }

.competitor-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--color-text-inverse);
    flex-shrink: 0;
    text-transform: uppercase;
}

.competitor-avatar-1 { background: linear-gradient(135deg, #2563EB, #7C3AED); }
.competitor-avatar-2 { background: linear-gradient(135deg, #10B981, #059669); }
.competitor-avatar-3 { background: linear-gradient(135deg, #F59E0B, #F97316); }
.competitor-avatar-4 { background: linear-gradient(135deg, #EF4444, #DC2626); }
.competitor-avatar-5 { background: linear-gradient(135deg, #8B5CF6, #6366F1); }

.competitor-info {
    flex: 1;
    min-width: 0;
}

.competitor-name {
    font-size: var(--text-base);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.competitor-url {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.competitor-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--color-primary-bg);
    color: var(--color-primary);
    font-size: var(--text-sm);
    font-weight: 700;
    flex-shrink: 0;
    border: 1px solid var(--color-primary-light);
}


/* ── 5. QUESTION REVEAL LIST ─────────────────────────────── */

.question-reveal-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.question-reveal-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    opacity: 0;
    transform: translateY(16px);
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.question-reveal-item:hover {
    border-color: var(--color-primary-light);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.question-reveal-item:nth-child(1)  { animation-delay: 0.05s; }
.question-reveal-item:nth-child(2)  { animation-delay: 0.12s; }
.question-reveal-item:nth-child(3)  { animation-delay: 0.19s; }
.question-reveal-item:nth-child(4)  { animation-delay: 0.26s; }
.question-reveal-item:nth-child(5)  { animation-delay: 0.33s; }
.question-reveal-item:nth-child(6)  { animation-delay: 0.4s; }
.question-reveal-item:nth-child(7)  { animation-delay: 0.47s; }
.question-reveal-item:nth-child(8)  { animation-delay: 0.54s; }
.question-reveal-item:nth-child(9)  { animation-delay: 0.61s; }
.question-reveal-item:nth-child(10) { animation-delay: 0.68s; }

.question-number {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: var(--color-text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

.question-reveal-text {
    flex: 1;
    font-size: var(--text-sm);
    color: var(--color-text);
    line-height: 1.5;
}

.question-category-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px var(--space-2);
    font-size: 0.6875rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}

.question-category-badge.cat-brand     { background: var(--color-primary-bg);   color: var(--color-primary); }
.question-category-badge.cat-product   { background: var(--color-secondary-bg); color: var(--color-secondary); }
.question-category-badge.cat-review    { background: var(--color-excellent-bg);  color: #065F46; }
.question-category-badge.cat-comparison { background: var(--color-good-bg);      color: #92400E; }
.question-category-badge.cat-technical { background: var(--color-critical-bg);   color: #991B1B; }


/* ── 6. SCAN COMPLETE CELEBRATION ────────────────────────── */

.scan-complete {
    text-align: center;
    padding: var(--space-10);
    background: var(--color-surface);
    border: 1px solid var(--color-excellent-border);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    animation: pulseGlow 2s ease-in-out 3;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.1);
}

.scan-complete::before,
.scan-complete::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    animation: confettiFall 3s ease-in-out infinite;
    pointer-events: none;
}

.scan-complete::before {
    background: var(--color-primary);
    left: 15%;
    top: -8px;
    animation-delay: 0s;
}

.scan-complete::after {
    background: var(--color-accent);
    right: 20%;
    top: -8px;
    animation-delay: 0.8s;
}

.scan-complete-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.confetti-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    top: -10px;
    animation: confettiFall 3.5s ease-in infinite;
    opacity: 0.8;
}

.confetti-particle:nth-child(1)  { left: 10%; background: #2563EB; animation-delay: 0s;    animation-duration: 3s;   }
.confetti-particle:nth-child(2)  { left: 25%; background: #10B981; animation-delay: 0.3s;  animation-duration: 3.5s; }
.confetti-particle:nth-child(3)  { left: 40%; background: #F59E0B; animation-delay: 0.6s;  animation-duration: 2.8s; }
.confetti-particle:nth-child(4)  { left: 55%; background: #7C3AED; animation-delay: 0.2s;  animation-duration: 3.2s; }
.confetti-particle:nth-child(5)  { left: 70%; background: #EF4444; animation-delay: 0.9s;  animation-duration: 3.4s; }
.confetti-particle:nth-child(6)  { left: 85%; background: #2563EB; animation-delay: 0.5s;  animation-duration: 2.9s; }
.confetti-particle:nth-child(7)  { left: 18%; background: #F97316; animation-delay: 1.1s;  animation-duration: 3.1s; }
.confetti-particle:nth-child(8)  { left: 65%; background: #10B981; animation-delay: 0.7s;  animation-duration: 3.3s; }

.scan-complete-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto var(--space-4);
    position: relative;
}

.scan-complete-icon svg {
    width: 72px;
    height: 72px;
}

.scan-complete-icon .check-circle {
    fill: none;
    stroke: var(--color-excellent);
    stroke-width: 2;
    stroke-dasharray: 220;
    stroke-dashoffset: 220;
    animation: drawCheck 0.8s cubic-bezier(0.65, 0, 0.35, 1) 0.3s forwards;
}

.scan-complete-icon .check-mark {
    fill: none;
    stroke: var(--color-excellent);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: drawCheck 0.5s cubic-bezier(0.65, 0, 0.35, 1) 0.9s forwards;
}

.scan-complete-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-2);
}

.scan-complete-subtitle {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-6);
}

.scan-stat-pills {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.scan-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--color-excellent-bg);
    color: #065F46;
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 600;
    border: 1px solid var(--color-excellent-border);
    animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.scan-stat-pill:nth-child(1) { animation-delay: 1.2s; }
.scan-stat-pill:nth-child(2) { animation-delay: 1.4s; }
.scan-stat-pill:nth-child(3) { animation-delay: 1.6s; }

.scan-stat-pill-value {
    font-size: var(--text-lg);
    font-weight: 700;
}


/* ── 7. ENHANCED SCORE RING (Dashboard) ──────────────────── */

.score-ring-animated {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.score-ring-animated svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-ring-animated .ring-bg {
    fill: none;
    stroke: var(--color-surface-hover);
    stroke-width: 8;
}

.score-ring-animated .ring-fill {
    fill: none;
    stroke: var(--color-primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 326.73;
    stroke-dashoffset: 326.73;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.score-ring-animated.score-excellent .ring-fill { stroke: url(#ring-gradient-excellent); }
.score-ring-animated.score-good .ring-fill      { stroke: url(#ring-gradient-good); }
.score-ring-animated.score-risky .ring-fill     { stroke: url(#ring-gradient-risky); }
.score-ring-animated.score-critical .ring-fill  { stroke: url(#ring-gradient-critical); }

.score-ring-animated .ring-value {
    font-size: var(--text-4xl);
    font-weight: 700;
    line-height: 1;
    position: relative;
    z-index: 1;
}

.score-ring-animated .ring-label {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    position: relative;
    z-index: 1;
    margin-top: var(--space-1);
}

.score-ring-glow {
    position: absolute;
    inset: -12px;
    border-radius: var(--radius-full);
    opacity: 0.3;
    filter: blur(16px);
    z-index: -1;
    animation: pulseGlow 3s ease-in-out infinite;
}

.score-excellent .score-ring-glow { background: var(--color-excellent); }
.score-good .score-ring-glow      { background: var(--color-good); }
.score-risky .score-ring-glow     { background: var(--color-risky); }
.score-critical .score-ring-glow  { background: var(--color-critical); }

.score-ring-animated.lg {
    width: 180px;
    height: 180px;
}

.score-ring-animated.lg .ring-value { font-size: var(--text-5xl); }


/* ── 8. INFO BUBBLES / TOOLTIPS ──────────────────────────── */

.info-bubble {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background: var(--color-surface-hover);
    color: var(--color-text-muted);
    font-size: 0.6875rem;
    font-weight: 700;
    cursor: help;
    transition: background var(--transition-fast), color var(--transition-fast);
    flex-shrink: 0;
    z-index: 1;
}

.info-bubble:hover {
    z-index: 9999;
}

.info-bubble:hover {
    background: var(--color-primary);
    color: var(--color-text-inverse);
}

.info-bubble-content {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    min-width: 220px;
    max-width: 300px;
    padding: var(--space-3) var(--space-4);
    background: #1F2937;
    color: #F3F4F6;
    font-size: var(--text-xs);
    font-weight: 400;
    line-height: 1.6;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 99999;
}

.info-bubble-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1F2937;
}

.info-bubble:hover .info-bubble-content {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    pointer-events: auto;
}

.info-bubble-content.pos-right {
    left: auto;
    right: 0;
    transform: translateX(0) scale(0.9);
}

.info-bubble:hover .info-bubble-content.pos-right {
    transform: translateX(0) scale(1);
}

.info-bubble-content.pos-right::after {
    left: auto;
    right: 12px;
    transform: none;
}


/* ── 9. AI VISIBILITY INDICATOR ──────────────────────────── */

.ai-presence {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
}

.ai-dot-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.ai-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.ai-dot.visible {
    background: var(--color-excellent);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
    animation: dotPulse 2s ease-in-out infinite;
}

.ai-dot.partial {
    background: var(--color-good);
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
    animation: dotPulse 2.5s ease-in-out infinite;
}

.ai-dot.absent {
    background: var(--color-critical);
    box-shadow: 0 0 4px rgba(239, 68, 68, 0.3);
}

.ai-dot-label {
    font-size: 0.5625rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
    line-height: 1;
}


/* ── 10. GLASS CARD EFFECT ───────────────────────────────── */

.glass-card {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: visible;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.glass-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.glass-card-glow {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    overflow: hidden;
    padding: 1px;
    background: linear-gradient(135deg,
        rgba(37, 99, 235, 0.3),
        rgba(124, 58, 237, 0.15),
        rgba(245, 158, 11, 0.2),
        rgba(37, 99, 235, 0.3)
    );
    background-size: 300% 300%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-base);
    animation: glowBorderRotate 6s linear infinite;
}

.glass-card:hover .glass-card-glow {
    opacity: 1;
}

@keyframes glowBorderRotate {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.glass-card-dark {
    background: rgba(15, 17, 23, 0.7);
    border-color: rgba(42, 45, 58, 0.6);
    color: #E5E7EB;
}


/* ── 11. STAGGER ANIMATIONS ──────────────────────────────── */

.stagger-1  { animation-delay: 0.05s !important; }
.stagger-2  { animation-delay: 0.1s  !important; }
.stagger-3  { animation-delay: 0.15s !important; }
.stagger-4  { animation-delay: 0.2s  !important; }
.stagger-5  { animation-delay: 0.25s !important; }
.stagger-6  { animation-delay: 0.3s  !important; }
.stagger-7  { animation-delay: 0.35s !important; }
.stagger-8  { animation-delay: 0.4s  !important; }
.stagger-9  { animation-delay: 0.45s !important; }
.stagger-10 { animation-delay: 0.5s  !important; }

.anim-fade-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.anim-fade-right {
    opacity: 0;
    transform: translateX(30px);
    animation: fadeInRight 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.anim-pop {
    opacity: 0;
    transform: scale(0.3);
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.anim-slide-down {
    opacity: 0;
    transform: translateY(-20px);
    animation: slideDown 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}


/* ── 12. ANALYSIS PROGRESS ───────────────────────────────── */

.analysis-progress-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    max-width: 480px;
    margin: 0 auto;
}

.analysis-progress-title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-5);
    text-align: center;
}

.analysis-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.analysis-step {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.analysis-step-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    flex-shrink: 0;
    border: 2px solid var(--color-border);
    color: var(--color-text-muted);
    background: var(--color-surface);
    transition: all var(--transition-base);
}

.analysis-step-label {
    flex: 1;
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}

.analysis-step-status {
    font-size: var(--text-xs);
    color: var(--color-text-placeholder);
    flex-shrink: 0;
}

.analysis-step.active {
    background: var(--color-primary-bg);
}

.analysis-step.active .analysis-step-icon {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: var(--color-text-inverse);
    animation: stepPulse 1.5s ease-in-out infinite;
}

.analysis-step.active .analysis-step-label {
    color: var(--color-primary);
    font-weight: 500;
}

.analysis-step.active .analysis-step-status {
    color: var(--color-primary);
}

.analysis-step.done .analysis-step-icon {
    border-color: var(--color-excellent);
    background: var(--color-excellent);
    color: var(--color-text-inverse);
}

.analysis-step.done .analysis-step-label {
    color: var(--color-text);
}

.analysis-step.done .analysis-step-status {
    color: var(--color-excellent);
    font-weight: 500;
}

.analysis-score-reveal {
    text-align: center;
    margin-top: var(--space-6);
    padding-top: var(--space-6);
    border-top: 1px solid var(--color-border);
}

.analysis-score-value {
    font-size: var(--text-5xl);
    font-weight: 800;
    line-height: 1;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    transform: scale(0.5);
    animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.analysis-score-value.revealed {
    opacity: 1;
    transform: scale(1);
    text-shadow: 0 0 40px rgba(37, 99, 235, 0.3);
}

.analysis-score-label {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-top: var(--space-2);
}

@keyframes stepPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
    50%      { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
}


/* ── 13. ENHANCED PROGRESS STEPS (Scan) ──────────────────── */

.progress-steps-enhanced {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
    padding: 0;
    margin: var(--space-8) auto var(--space-2);
    max-width: 420px;
}

.progress-steps-enhanced::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 18px;
    right: 18px;
    height: 2px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    z-index: 0;
}

.progress-steps-enhanced::after {
    content: '';
    position: absolute;
    top: 18px;
    left: 18px;
    height: 2px;
    background: var(--color-primary);
    border-radius: var(--radius-full);
    z-index: 0;
    width: var(--step-progress, 0%);
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-step-enhanced {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 1;
    flex: 1 1 0;
    min-width: 0;
}

.progress-step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    background: var(--color-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.progress-step-circle svg {
    width: 16px;
    height: 16px;
}

.progress-step-enhanced.active .progress-step-circle {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.12);
    animation: ringPulse 2s ease-in-out infinite;
}

.progress-step-enhanced.done .progress-step-circle {
    border-color: var(--color-excellent, #22c55e);
    background: var(--color-excellent, #22c55e);
    color: #fff;
}

.progress-step-enhanced.done .progress-step-circle .check-draw {
    fill: none;
    stroke: #fff;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 24;
    stroke-dashoffset: 24;
    animation: drawCheck 0.4s ease 0.1s forwards;
}

.progress-step-label-enhanced {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-align: center;
    white-space: nowrap;
    transition: color var(--transition-fast);
}

.progress-step-enhanced.active .progress-step-label-enhanced {
    color: var(--color-primary);
    font-weight: 600;
}

.progress-step-enhanced.done .progress-step-label-enhanced {
    color: var(--color-text);
    font-weight: 600;
}

@keyframes ringPulse {
    0%, 100% { box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.12); }
    50%      { box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
}


/* ── 14. PARTICLE / SHIMMER EFFECTS ──────────────────────── */

.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    animation: shimmerSweep 2s ease-in-out infinite;
    pointer-events: none;
}

.shimmer-dark::after {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.08) 50%,
        transparent 100%
    );
}

.glow-pulse {
    animation: pulseGlow 2.5s ease-in-out infinite;
}

.glow-pulse-primary { box-shadow: 0 0 20px rgba(37, 99, 235, 0.2); }
.glow-pulse-success { box-shadow: 0 0 20px rgba(16, 185, 129, 0.2); }
.glow-pulse-warning { box-shadow: 0 0 20px rgba(245, 158, 11, 0.2); }
.glow-pulse-danger  { box-shadow: 0 0 20px rgba(239, 68, 68, 0.2); }


/* ── KEYFRAMES ───────────────────────────────────────────── */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    70% {
        opacity: 1;
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes typeWriter {
    from { max-width: 0; }
    to   { max-width: 100%; }
}

@keyframes blinkCursor {
    0%, 100% { border-color: var(--color-primary); }
    50%      { border-color: transparent; }
}

@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.6; }
    50%      { opacity: 1; }
}

@keyframes shimmerSweep {
    0%   { left: -100%; }
    100% { left: 100%; }
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(400px) rotate(720deg);
        opacity: 0;
    }
}

@keyframes expandLine {
    from { width: 0; }
    to   { width: 100%; }
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.3); opacity: 0.7; }
}


/* ── RESPONSIVE — MOBILE ADJUSTMENTS ─────────────────────── */

@media (max-width: 639px) {
    .brand-name-text {
        font-size: var(--text-2xl);
    }

    .scan-complete {
        padding: var(--space-6);
    }

    .scan-complete-title {
        font-size: var(--text-xl);
    }

    .score-ring-animated {
        width: 110px;
        height: 110px;
    }

    .score-ring-animated .ring-value {
        font-size: var(--text-3xl);
    }

    .score-ring-animated.lg {
        width: 140px;
        height: 140px;
    }

    .progress-steps-enhanced {
        max-width: 320px;
    }

    .progress-step-circle {
        width: 30px;
        height: 30px;
    }

    .progress-step-circle svg {
        width: 13px;
        height: 13px;
    }

    .progress-steps-enhanced::before,
    .progress-steps-enhanced::after {
        top: 15px;
        left: 15px;
        right: 15px;
    }

    .progress-step-label-enhanced {
        font-size: 0.6rem;
    }

    .competitor-card {
        padding: var(--space-3);
        gap: var(--space-3);
    }

    .competitor-avatar {
        width: 36px;
        height: 36px;
        font-size: var(--text-base);
    }

    .info-bubble-content {
        min-width: 180px;
        max-width: 240px;
    }

    .analysis-progress-panel {
        padding: var(--space-4);
    }

    .analysis-score-value {
        font-size: var(--text-4xl);
    }
}


/* ── ACCESSIBILITY — REDUCED MOTION ──────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .scan-phase,
    .scan-phase.active,
    .keyword-chip,
    .competitor-card,
    .question-reveal-item,
    .scan-stat-pill,
    .anim-fade-up,
    .anim-fade-right,
    .anim-pop,
    .anim-slide-down,
    .analysis-score-value,
    .confetti-particle {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .brand-name-text {
        animation: none !important;
        border-color: transparent !important;
    }

    .identity-scan-anim,
    .identity-scan-anim * {
        animation: none !important;
    }

    .scan-complete::before,
    .scan-complete::after {
        animation: none !important;
    }

    .scan-complete-icon .check-circle,
    .scan-complete-icon .check-mark,
    .progress-step-enhanced.done .progress-step-circle .check-draw {
        animation: none !important;
        stroke-dashoffset: 0 !important;
    }

    .score-ring-animated .ring-fill {
        transition: none !important;
    }

    .score-ring-glow,
    .sector-badge,
    .glow-pulse {
        animation: none !important;
    }

    .shimmer::after {
        animation: none !important;
        display: none;
    }

    .glass-card-glow {
        animation: none !important;
    }

    .ai-dot.visible,
    .ai-dot.partial {
        animation: none !important;
    }

    .analysis-step.active .analysis-step-icon {
        animation: none !important;
    }

    .progress-step-enhanced.active .progress-step-circle {
        animation: none !important;
    }

    .scan-phase-header::after {
        animation: none !important;
        width: 100%;
    }

    .progress-line-fill {
        transition: none !important;
    }

    .brand-reveal::before {
        animation: none !important;
        opacity: 0.6;
    }
}
