/* ============================================================
   AlvoSEO Business Analyzer — WordPress Plugin Styles
   Fully namespaced under .alvoseo-analyzer to avoid conflicts
   with Astra/Elementor themes.

   EMBEDDED MODE: The search hero (Step 1) is transparent and
   designed to sit inside the site's existing green hero section.
   Steps 2–3 use their own dark card backgrounds.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* === CSS Variables (scoped) === */
.alvoseo-analyzer {
    --alvo-green: #4caf50;
    --alvo-green-dark: #388e3c;
    --alvo-green-light: #e8f5e9;
    --alvo-bg: #f8fafc;
    --alvo-card-bg: #ffffff;
    --alvo-text: #0f172a;
    --alvo-text-muted: #64748b;
    --alvo-border: rgba(0,0,0,0.08);
    --alvo-radius: 16px;
    --alvo-radius-sm: 10px;
    --alvo-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    font-family: var(--alvo-font);
    line-height: 1.6;
    box-sizing: border-box;
    position: relative;
    transition: all 0.5s ease;
}

/* Takeover mode: full screen overlay with blur */
.alvoseo-analyzer.alvo-takeover {
    position: fixed;
    top: 0; /* Will be overridden by JS if header is found */
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.alvoseo-analyzer *, .alvoseo-analyzer *::before, .alvoseo-analyzer *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* =========================
   STEP 1: SEARCH HERO — EMBEDDED (transparent, fits green hero)
   ========================= */
.alvo-hero {
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px 24px 20px;
    position: relative;
    overflow: visible; /* Fixed dropdown clipping */
}

/* Image grid for Brand Card */
.alvo-brand-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.alvo-brand-img-placeholder {
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    border: 1px dashed rgba(255,255,255,0.1);
}

/* No radial gradient glow in embedded mode */
.alvo-hero::before {
    display: none;
}

/* Hide the heading in embedded mode — the existing Elementor hero provides it */
.alvo-hero h2 {
    display: none;
}

/* Hide the paragraph too */
.alvo-hero p.alvo-hero-desc {
    display: none;
}

.alvo-search-form {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 600px;
    position: relative;
}

.alvo-search-form .alvo-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.alvo-search-form input {
    width: 100%;
    padding: 16px 20px 16px 48px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--alvo-radius);
    font-size: 16px;
    background: #fff;
    color: #1f2937;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.alvo-search-form input:focus,
.alvo-search-form input:focus-visible {
    outline: none !important;
    border-color: var(--alvo-green);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.alvo-input-wrapper > svg {
    position: absolute;
    left: 16px;
    color: #9ca3af;
    width: 20px;
    height: 20px;
}

/* Autocomplete Dropdown */
.alvo-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border-radius: var(--alvo-radius);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
    z-index: 50;
    max-height: 240px;
    overflow-y: auto;
}

.alvo-autocomplete-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: #4b5563;
    font-size: 14px;
    border-bottom: 1px solid #f3f4f6;
    text-align: left;
}

.alvo-autocomplete-item:last-child {
    border-bottom: none;
}

.alvo-autocomplete-item:hover {
    background: #f9fafb;
    color: var(--alvo-green);
}

.alvo-autocomplete-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.alvo-search-form input[type="text"]::placeholder {
    color: #9ca3af;
}

.alvo-search-form input[type="text"]:focus {
    border-color: var(--alvo-green-dark);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15), 0 0 0 3px rgba(76,175,80,0.2);
}

.alvo-btn-primary {
    padding: 16px 28px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--alvo-font);
    background: #ffffff;
    color: var(--alvo-green);
    border: 2px solid rgba(255,255,255,0.7);
    border-radius: 50px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.alvo-btn-primary:hover {
    background: var(--alvo-green-dark);
    color: #fff;
    border-color: var(--alvo-green-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.alvo-social-proof {
    margin-top: 16px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.alvo-social-proof svg {
    color: rgba(255,255,255,0.85);
}

/* =========================
   STEP 2: ANALYSIS PROGRESS (dark card — pops out)
   ========================= */
.alvo-progress {
    background: transparent;
    padding: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--alvo-text);
}

.alvo-progress-card {
    background: var(--alvo-card-bg);
    border: 1px solid var(--alvo-border);
    border-radius: var(--alvo-radius);
    width: 100%;
    max-width: 780px;
    overflow: hidden;
    animation: alvoScaleUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes alvoScaleUp {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.alvo-progress-header {
    padding: 20px 28px;
    border-bottom: 1px solid var(--alvo-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.alvo-ping-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--alvo-green);
    position: relative;
    flex-shrink: 0;
}

.alvo-ping-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--alvo-green);
    animation: alvoPing 1.5s cubic-bezier(0,0,0.2,1) infinite;
}

@keyframes alvoPing {
    0%   { transform: scale(1); opacity: 0.75; }
    75%, 100% { transform: scale(2.5); opacity: 0; }
}

.alvo-progress-header span {
    font-size: 0.9rem;
    color: var(--alvo-text-muted);
}

.alvo-card-content {
    padding: 28px;
    min-height: 260px;
    position: relative;
    overflow: hidden;
}

/* Analysis Cards (inner) */
.alvo-analysis-card {
    display: flex;
    gap: 28px;
    opacity: 0;
    transform: translateX(40px);
    animation: alvoSlideIn 0.5s ease forwards;
}

@keyframes alvoSlideIn {
    to { opacity: 1; transform: translateX(0); }
}

.alvo-analysis-card.alvo-exit {
    animation: alvoSlideOut 0.4s ease forwards;
}

@keyframes alvoSlideOut {
    to { opacity: 0; transform: translateX(-40px); }
}

.alvo-visual-side {
    width: 220px;
    min-height: 200px;
    border-radius: var(--alvo-radius-sm);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.alvo-visual-side.alvo-map-bg {
    background: linear-gradient(135deg, #1a2332 0%, #0d1b2a 100%);
}

.alvo-visual-side.alvo-photo-bg {
    background: linear-gradient(135deg, #1a2332 0%, #162032 100%);
}

.alvo-visual-side.alvo-sentiment-bg {
    background: linear-gradient(135deg, #0b2914 0%, #0d1b2a 100%);
    flex-direction: column;
}

.alvo-radar-ping {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 2px solid rgba(76,175,80,0.3);
    animation: alvoRadar 2s ease-out infinite;
}

@keyframes alvoRadar {
    0%   { transform: scale(0.3); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

.alvo-map-pin {
    position: relative;
    z-index: 2;
}

.alvo-map-pin svg {
    fill: var(--alvo-green);
    width: 36px;
    height: 36px;
}

.alvo-sentiment-icon svg {
    width: 56px;
    height: 56px;
    color: var(--alvo-green);
}

.alvo-sentiment-pill {
    margin-top: 12px;
    background: rgba(76,175,80,0.15);
    color: var(--alvo-green);
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.alvo-carousel-dots {
    position: absolute;
    bottom: 12px;
    display: flex;
    gap: 6px;
}

.alvo-carousel-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
}

.alvo-carousel-dots span.active {
    background: var(--alvo-green);
}

.alvo-data-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.alvo-data-side h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
}

.alvo-data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    padding: 8px 0;
    border-bottom: 1px solid var(--alvo-border);
    color: var(--alvo-text);
}

.alvo-data-row .alvo-label { color: var(--alvo-text-muted); }
.alvo-data-row .alvo-value { color: var(--alvo-green); font-weight: 600; }
.alvo-data-row .alvo-value.grey { color: var(--alvo-text-muted); }

.alvo-data-row .alvo-value svg {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-left: 4px;
}

.alvo-status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--alvo-green);
    margin-top: 4px;
}

.alvo-status-badge svg {
    width: 16px;
    height: 16px;
}

/* Quality bar */
.alvo-quality-bar {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    margin: 0 10px;
    overflow: hidden;
}

.alvo-quality-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--alvo-green);
    width: 72%;
    animation: alvoGrow 1.5s ease forwards;
}

@keyframes alvoGrow {
    from { width: 0; }
}

/* Init spinner */
.alvo-init-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    gap: 16px;
    color: var(--alvo-text-muted);
    font-size: 0.95rem;
}

.alvo-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--alvo-border);
    border-top-color: var(--alvo-green);
    border-radius: 50%;
    animation: alvoSpin 0.8s linear infinite;
}

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

/* Progress bar */
.alvo-progress-bar-container {
    height: 4px;
    background: rgba(255,255,255,0.05);
}

.alvo-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--alvo-green), #66bb6a);
    border-radius: 0 2px 2px 0;
    transition: width 0.6s ease;
}

/* =========================
   STEP 3: DASHBOARD OVERLAY + LEAD FORM
   ========================= */
.alvo-dashboard {
    background: var(--alvo-bg); /* Solid background to completely hide the website */
    width: 100vw;
    height: 100vh;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--alvo-text);
    z-index: 10;
}

/* Blurred mock dashboard */
.alvo-blurred-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-image: url('dashboard-bg-light.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(8px);
    transform: scale(1.05); /* Prevent blurred edges from leaking */
    opacity: 0.8;
    z-index: 1;
}

.alvo-mock-sidebar {
    width: 240px;
    background: rgba(255,255,255,0.08);
    border-right: 1px solid rgba(255,255,255,0.1);
}

.alvo-mock-main {
    flex: 1;
    padding: 24px;
}

.alvo-mock-header {
    height: 60px;
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    margin-bottom: 24px;
}

.alvo-mock-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.alvo-mock-card {
    height: 160px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alvo-mock-card.alvo-mock-chart {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
}

.alvo-fake-line {
    height: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
}

.alvo-fake-bar {
    flex: 1;
    background: var(--alvo-green);
    opacity: 0.5;
    border-radius: 4px 4px 0 0;
}

.alvo-mock-card.full {
    grid-column: span 2;
    height: 100px;
}

/* Glass modal overlay */
.alvo-glass-modal {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: var(--alvo-radius);
    padding: 48px 40px;
    max-width: 480px;
    width: 90%;
    animation: alvoFadeUp 0.6s ease;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.alvo-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.1);
    color: var(--alvo-text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.alvo-modal-close:hover {
    background: rgba(0,0,0,0.1);
    color: #000;
}

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

.alvo-glass-modal h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--alvo-text);
    margin-bottom: 4px;
}

.alvo-glass-modal h3 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--alvo-green);
    margin-bottom: 16px;
}

.alvo-glass-modal .alvo-modal-desc {
    color: var(--alvo-text-muted);
    font-size: 0.95rem;
    margin-bottom: 28px;
    line-height: 1.6;
}

/* Lead form */
.alvo-lead-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.alvo-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.alvo-form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--alvo-text-muted);
}

.alvo-form-group input {
    padding: 12px 14px;
    font-size: 0.95rem;
    font-family: var(--alvo-font);
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--alvo-border);
    border-radius: 8px;
    color: var(--alvo-text);
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.alvo-form-group input:focus {
    border-color: var(--alvo-green);
    box-shadow: 0 0 0 3px rgba(76,175,80,0.12);
}

.alvo-form-group input::placeholder {
    color: rgba(255,255,255,0.3);
}

.alvo-btn-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--alvo-font);
    background: var(--alvo-green);
    color: #fff;
    border: none;
    border-radius: var(--alvo-radius-sm);
    cursor: pointer;
    transition: background 0.25s, transform 0.15s;
    margin-top: 4px;
}

.alvo-btn-cta:hover {
    background: var(--alvo-green-dark);
    transform: translateY(-1px);
}

.alvo-btn-cta svg {
    width: 18px;
    height: 18px;
}

.alvo-privacy-note {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--alvo-text-muted);
    margin-top: 8px;
}

.alvo-privacy-note svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Success state */
.alvo-success-message {
    text-align: center;
    padding: 60px 24px;
}

.alvo-success-message svg {
    width: 64px;
    height: 64px;
    color: var(--alvo-green);
    margin-bottom: 20px;
}

.alvo-success-message h2 {
    font-size: 1.6rem;
    color: #fff;
    margin-bottom: 8px;
}

.alvo-success-message p {
    color: var(--alvo-text-muted);
    font-size: 1rem;
}

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 768px) {
    .alvo-search-form { flex-direction: column; }
    .alvo-analysis-card { flex-direction: column; }
    .alvo-visual-side { width: 100%; min-height: 140px; }
    .alvo-glass-modal { padding: 32px 24px; }
    .alvo-mock-sidebar { display: none; }
}
