/* ============================================
   NimbusMesh App — URL-first Analysis Dashboard
   ============================================ */

/* Screens */
.app-full-screen {
    min-height: calc(100vh - 60px);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   Screen 1: URL Input
   ============================================ */

.url-card-wrap {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 620px;
    padding: 2rem;
}

.url-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
}

.url-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin: 0 auto 1.25rem;
}

.url-card-title {
    font-family: var(--font-body);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
}

.url-card-sub {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 1.75rem;
}

.url-input-row {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.url-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 0 1.25rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.url-input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.url-input-wrap i {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.url-input-wrap input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text);
    padding: 0.85rem 0;
    outline: none;
}

.url-input-wrap input::placeholder {
    color: var(--text-muted);
}

.url-card-hint {
    font-size: 0.8rem;
    color: var(--destructive);
    margin-top: 0.75rem;
}

/* ============================================
   Niche Confirmation Modal
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.niche-card {
    background: #fff;
    border-radius: 24px;
    padding: 2.5rem;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.15);
    text-align: center;
    animation: modalIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.92) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.niche-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--accent-glow);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin: 0 auto 1rem;
}

.niche-card h2 {
    font-family: var(--font-body);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 1rem;
}

.niche-badges {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.niche-badge, .scope-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.niche-badge {
    background: var(--accent-glow);
    color: var(--accent);
}

.scope-badge {
    background: rgba(5, 150, 105, 0.1);
    color: var(--green);
}

.niche-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 1.25rem;
}

.niche-form-row {
    text-align: left;
    margin-bottom: 0.75rem;
}

.niche-form-row label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.3rem;
}

.niche-form-row input, .niche-form-row select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text);
    background: var(--bg);
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.niche-form-row input:focus, .niche-form-row select:focus {
    border-color: var(--accent);
}

/* ============================================
   Screen 2: Analysis Dashboard
   ============================================ */

.analysis-layout {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 5rem 1.5rem 2rem;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
    min-height: calc(100vh - 60px);
}

/* Progress Panel */
.progress-panel {
    position: sticky;
    top: 80px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

.progress-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.progress-spinner {
    width: 52px;
    height: 52px;
    margin: 0 auto 0.75rem;
    position: relative;
}

.spin-ring {
    position: absolute;
    border-radius: 50%;
    border: 3px solid transparent;
}

.spin-ring.r1 { inset: 0; border-top-color: var(--accent); animation: spin 1.2s linear infinite; }
.spin-ring.r2 { inset: 6px; border-right-color: var(--accent-light); animation: spin 1.8s linear infinite reverse; }
.spin-ring.r3 { inset: 12px; border-bottom-color: var(--green); animation: spin 2.4s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

.progress-spinner.done .spin-ring { animation: none; border-color: transparent; }
.progress-spinner.done::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green);
    font-size: 1.5rem;
}

.progress-title {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.25rem;
}

.progress-url {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
    word-break: break-all;
}

/* Progress Steps */
.progress-steps { display: flex; flex-direction: column; }

.p-step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.7rem 0;
    position: relative;
}

.p-step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 9px;
    top: 2.2rem;
    bottom: -0.35rem;
    width: 2px;
    background: var(--border);
    transition: background 0.5s;
}

.p-step.done:not(:last-child)::after { background: var(--green); }
.p-step.active:not(:last-child)::after { background: var(--accent); }

.p-step-dot {
    width: 20px; height: 20px; min-width: 20px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.4s;
    margin-top: 1px;
}

.p-step.active .p-step-dot {
    border-color: var(--accent);
    background: var(--accent-glow);
    box-shadow: 0 0 0 4px var(--accent-glow);
    animation: stepPulse 1.5s ease infinite;
}

@keyframes stepPulse {
    0%, 100% { box-shadow: 0 0 0 4px var(--accent-glow); }
    50% { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0.05); }
}

.p-step.done .p-step-dot {
    border-color: var(--green);
    background: var(--green);
    animation: none;
}

.p-step.done .p-step-dot::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.55rem;
    color: #fff;
}

.p-step-info { display: flex; flex-direction: column; }

.p-step-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    transition: color 0.3s;
}

.p-step.done .p-step-name { color: var(--green); }

.p-step-detail { font-size: 0.72rem; color: var(--text-muted); }

/* Metrics Panel */
.metrics-panel { display: flex; flex-direction: column; gap: 1.5rem; }

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.m-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.m-card.visible { opacity: 1; transform: translateY(0); }

.m-card-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.75rem;
    display: flex; align-items: center; gap: 0.4rem;
}

.m-card-header i { color: var(--accent); }

.m-card-body { min-height: 80px; }

/* Score Ring */
.score-ring { width: 100px; height: 100px; position: relative; margin: 0 auto; }
.score-ring svg { transform: rotate(-90deg); }

.score-number {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.75rem; font-weight: 700; color: var(--text);
}

/* AI Visibility */
.ai-stat { text-align: center; margin-bottom: 0.75rem; }
.ai-big { font-size: 2rem; font-weight: 700; color: var(--text); }
.ai-label { font-size: 0.85rem; color: var(--text-muted); margin-left: 0.25rem; }

.ai-dots { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }

.ai-dot-label {
    display: flex; align-items: center; gap: 0.35rem;
    font-size: 0.72rem; color: var(--text-secondary);
    padding: 0.2rem 0.5rem; border-radius: 6px; background: var(--bg);
}

.ai-dot-label .dot {
    width: 8px; height: 8px; border-radius: 50%;
}

.ai-dot-label .dot.found { background: var(--green); }
.ai-dot-label .dot.not-found { background: var(--border); }

/* Social Presence */
.social-grid { display: flex; flex-direction: column; gap: 0.4rem; }

.social-row {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.8rem; color: var(--text-secondary);
}

.social-row i { width: 18px; text-align: center; }
.social-row .found { color: var(--green); }
.social-row .missing { color: var(--text-muted); opacity: 0.5; }

/* SEO Keywords */
.seo-list { display: flex; flex-direction: column; gap: 0.35rem; }

.seo-row {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.78rem; color: var(--text-secondary);
}

.seo-row i { font-size: 0.65rem; }
.seo-row .found { color: var(--green); }
.seo-row .missing { color: var(--destructive); }

/* Competitors */
.m-card-competitors { grid-column: 1 / -1; }

.comp-list { display: flex; flex-direction: column; gap: 0.4rem; }

.comp-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.4rem 0.6rem; background: var(--bg); border-radius: 8px; font-size: 0.8rem;
}

.comp-name { font-weight: 600; color: var(--text); }

.comp-badge {
    font-size: 0.65rem; font-weight: 600; padding: 2px 6px; border-radius: 4px;
}

.comp-badge.dominant { background: rgba(220, 38, 38, 0.1); color: var(--destructive); }
.comp-badge.seo-only { background: rgba(99, 102, 241, 0.1); color: var(--accent); }

#view-report-btn {
    width: 100%; padding: 1rem 2rem; font-size: 1.05rem;
    animation: fadeSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ============================================
   Screen 3: Report
   ============================================ */

.report-top-bar {
    display: flex; gap: 0.75rem; padding: 1rem 2rem;
    position: sticky; top: 60px; z-index: 10;
    background: rgba(248, 250, 252, 0.9);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

#report-container { max-width: 800px; margin: 0 auto; padding: 2rem; }

#report-body { font-family: var(--font-body); font-size: 0.95rem; line-height: 1.75; color: var(--text); }
#report-body h1 { font-size: 1.75rem; font-weight: 700; margin: 2rem 0 1rem; letter-spacing: -0.02em; }
#report-body h2 { font-size: 1.3rem; font-weight: 700; margin: 2rem 0 0.75rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
#report-body h3 { font-size: 1.05rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
#report-body table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.85rem; }
#report-body th, #report-body td { padding: 0.6rem 0.85rem; text-align: left; border-bottom: 1px solid var(--border); }
#report-body th { font-weight: 600; color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; }
#report-body blockquote { margin: 1rem 0; padding: 0.85rem 1.25rem; border-left: 3px solid var(--accent); background: var(--accent-glow); border-radius: 0 8px 8px 0; font-size: 0.9rem; color: var(--text-secondary); }
#report-body ul, #report-body ol { padding-left: 1.5rem; margin: 0.75rem 0; }
#report-body li { margin: 0.35rem 0; }
#report-body strong { color: var(--text); }

/* Unlock Bar */
#unlock-bar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    background: linear-gradient(135deg, var(--bg-dark), #1e293b);
    padding: 1rem 2rem;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp { from { transform: translateY(100%); } }

.unlock-bar-inner {
    max-width: 900px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}

.unlock-bar-text {
    color: var(--text-on-dark); font-size: 0.9rem;
    display: flex; align-items: center; gap: 0.75rem;
}

.price-strike { text-decoration: line-through; opacity: 0.5; }

.report-section-locked { position: relative; filter: blur(4px); pointer-events: none; user-select: none; }

.lock-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    background: rgba(255, 255, 255, 0.6); border-radius: 12px;
    font-weight: 600; color: var(--text-muted); z-index: 5; filter: none;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 900px) {
    .analysis-layout { grid-template-columns: 1fr; padding: 4.5rem 1rem 2rem; }
    .progress-panel { position: static; }
    .metrics-grid { grid-template-columns: 1fr; }
    .url-card { padding: 2rem 1.5rem; }
    .url-input-row { flex-direction: column; }
}

@media (max-width: 640px) {
    .url-card-title { font-size: 1.4rem; }
    .niche-card { padding: 1.75rem; }
    .unlock-bar-inner { flex-direction: column; text-align: center; }
}
