/**
 * AgentExit - Landing Page CSS
 * Mobile-first, responsive layout
 */

/* ============================================================
   Utility: visibility helpers
   ============================================================ */

.sp-only { display: none; }
.pc-only { display: inline; }

/* ============================================================
   1. Hero Section
   ============================================================ */

.lp-hero {
    position: relative;
    padding: calc(var(--header-h) + 80px) 0 80px;
    overflow: hidden;
    background: var(--bg-primary);
}

/* Subtle grid / gradient background layer */
.lp-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(37, 99, 235, 0.06) 0%, transparent 70%),
        linear-gradient(180deg, transparent 60%, var(--bg-secondary) 100%);
    pointer-events: none;
    z-index: 0;
}

[data-theme="dark"] .lp-hero-bg {
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(96, 165, 250, 0.08) 0%, transparent 70%),
        linear-gradient(180deg, transparent 60%, var(--bg-secondary) 100%);
}

.lp-hero > .container {
    position: relative;
    z-index: 1;
}

.lp-hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

/* Badge */
.lp-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--ae-accent-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 24px;
    letter-spacing: 0.02em;
}

.lp-hero-badge .lucide-icon {
    width: 14px;
    height: 14px;
    color: var(--link-color);
}

/* Title */
.lp-hero-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.lp-hero-highlight {
    position: relative;
    display: inline-block;
    background: linear-gradient(135deg, var(--link-color) 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .lp-hero-highlight {
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Description */
.lp-hero-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
    max-width: 580px;
    margin: 0 auto 32px;
}

.lp-hero-desc strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* CTA Buttons */
.lp-hero-cta {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 48px;
}

/* Stats */
.lp-hero-stats {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 40px;
}

.lp-hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 32px;
}

.lp-hero-stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border);
    flex-shrink: 0;
}

.lp-hero-stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text-primary);
    line-height: 1;
}

.lp-hero-stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 6px;
    white-space: nowrap;
}

/* ============================================================
   2. Section Common
   ============================================================ */

.lp-section {
    padding: 80px 0;
    background: var(--bg-primary);
}

.lp-section--alt {
    background: var(--bg-secondary);
}

.lp-section-title {
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.lp-section-desc {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 48px;
}

.lp-section-cta {
    text-align: center;
    margin-top: 40px;
}

/* ============================================================
   3. Categories Grid
   ============================================================ */

.lp-categories {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.lp-category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-primary);
    transition:
        border-color var(--transition-base),
        box-shadow var(--transition-base),
        transform var(--transition-base);
    cursor: pointer;
}

.lp-category-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: var(--text-primary);
}

.lp-section--alt .lp-category-card {
    background: var(--bg-primary);
}

.lp-category-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    transition: background var(--transition-base);
}

.lp-category-card:hover .lp-category-icon {
    background: var(--ae-accent-muted);
}

.lp-category-icon .lucide-icon {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
}

.lp-category-card:hover .lp-category-icon .lucide-icon {
    color: var(--link-color);
}

.lp-category-name {
    font-size: 0.875rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.lp-category-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ============================================================
   4. Listing Card
   ============================================================ */

.lp-listing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.listing-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    transition:
        border-color var(--transition-base),
        box-shadow var(--transition-base),
        transform var(--transition-base);
}

.listing-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
    color: var(--text-primary);
}

/* Thumbnail */
.listing-card-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-surface);
    flex-shrink: 0;
}

.listing-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

.listing-card:hover .listing-card-thumb img {
    transform: scale(1.04);
}

.listing-card-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.listing-card-thumb-placeholder .lucide-icon {
    width: 40px;
    height: 40px;
    color: var(--text-muted);
    opacity: 0.5;
}

/* Badge */
.listing-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    pointer-events: none;
}

/* Category badge colors */
.badge-cat-mcp_tool {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}
.badge-cat-ai_agent {
    background: rgba(124, 58, 237, 0.12);
    color: #6d28d9;
}
.badge-cat-ai_ide {
    background: rgba(67, 56, 202, 0.12);
    color: #3730a3;
}
.badge-cat-prompt {
    background: rgba(217, 119, 6, 0.13);
    color: #b45309;
}
.badge-cat-ai_site {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}
.badge-cat-ai_account {
    background: rgba(219, 39, 119, 0.12);
    color: #be185d;
}
.badge-cat-ai_saas {
    background: rgba(8, 145, 178, 0.12);
    color: #0e7490;
}
.badge-cat-ai_company {
    background: rgba(71, 85, 105, 0.12);
    color: #334155;
}

[data-theme="dark"] .badge-cat-mcp_tool    { background: rgba(37, 99, 235, 0.2);   color: #93c5fd; }
[data-theme="dark"] .badge-cat-ai_agent    { background: rgba(124, 58, 237, 0.2);  color: #c4b5fd; }
[data-theme="dark"] .badge-cat-ai_ide      { background: rgba(67, 56, 202, 0.2);   color: #a5b4fc; }
[data-theme="dark"] .badge-cat-prompt      { background: rgba(217, 119, 6, 0.2);   color: #fcd34d; }
[data-theme="dark"] .badge-cat-ai_site     { background: rgba(22, 163, 74, 0.2);   color: #86efac; }
[data-theme="dark"] .badge-cat-ai_account  { background: rgba(219, 39, 119, 0.2);  color: #f9a8d4; }
[data-theme="dark"] .badge-cat-ai_saas     { background: rgba(8, 145, 178, 0.2);   color: #67e8f9; }
[data-theme="dark"] .badge-cat-ai_company  { background: rgba(71, 85, 105, 0.2);   color: #94a3b8; }

/* Card body */
.listing-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.listing-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.listing-card-price {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--link-color);
    margin-top: 8px;
    letter-spacing: -0.01em;
}

[data-theme="dark"] .listing-card-price {
    color: #60a5fa;
}

.listing-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 12px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.listing-card-seller {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 55%;
}

.listing-card-seller .lucide-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.listing-card-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.listing-card-stat {
    display: flex;
    align-items: center;
    gap: 3px;
}

.listing-card-stats .lucide-icon,
.listing-card-stat .lucide-icon {
    width: 12px;
    height: 12px;
}

/* ============================================================
   5. Features Grid
   ============================================================ */

.lp-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.lp-feature {
    padding: 28px 24px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.lp-feature:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}

.lp-feature-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.lp-feature-icon .lucide-icon {
    width: 24px;
    height: 24px;
    color: var(--link-color);
}

[data-theme="dark"] .lp-feature-icon .lucide-icon {
    color: #60a5fa;
}

.lp-feature-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.lp-feature-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.75;
}

/* ============================================================
   6. Steps (How it works)
   ============================================================ */

.lp-steps {
    display: flex;
    align-items: flex-start;
    gap: 0;
}

.lp-step {
    flex: 1;
    text-align: center;
    padding: 32px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    position: relative;
}

.lp-step-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    flex-shrink: 0;
    padding-top: 56px;
    color: var(--text-muted);
}

.lp-step-arrow .lucide-icon {
    width: 20px;
    height: 20px;
}

.lp-step-num {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--ae-accent);
    color: var(--bg-primary);
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

[data-theme="dark"] .lp-step-num {
    background: #ffffff;
    color: #0d0d0d;
}

.lp-step-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.lp-step-icon .lucide-icon {
    width: 22px;
    height: 22px;
    color: var(--link-color);
}

[data-theme="dark"] .lp-step-icon .lucide-icon {
    color: #60a5fa;
}

.lp-step-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.lp-step-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ============================================================
   7. CTA Section (dark)
   ============================================================ */

.lp-section--cta {
    background: var(--bg-dark);
    color: var(--text-white);
}

.lp-cta-box {
    text-align: center;
    padding: 60px 24px;
    max-width: 640px;
    margin: 0 auto;
}

.lp-cta-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 28px;
}

.lp-cta-icon .lucide-icon {
    width: 32px;
    height: 32px;
    color: #60a5fa;
}

.lp-cta-title {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 3vw, 1.875rem);
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-bottom: 16px;
}

.lp-cta-desc {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.95rem;
    margin-bottom: 36px;
    line-height: 1.7;
}

.lp-cta-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Override btn-ghost in dark CTA */
.lp-section--cta .btn-ghost {
    color: rgba(255, 255, 255, 0.75);
    border-color: rgba(255, 255, 255, 0.2);
}

.lp-section--cta .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

/* ============================================================
   8. Responsive - Tablet (max 960px)
   ============================================================ */

@media (max-width: 960px) {
    .lp-categories {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }

    .lp-listing-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .lp-features {
        grid-template-columns: repeat(2, 1fr);
    }

    .lp-steps {
        gap: 8px;
    }

    .lp-step-arrow .lucide-icon {
        width: 16px;
        height: 16px;
    }

    .lp-hero-stats {
        padding: 16px 24px;
    }

    .lp-hero-stat {
        padding: 0 20px;
    }
}

/* ============================================================
   9. Responsive - Mobile (max 640px)
   ============================================================ */

@media (max-width: 640px) {
    .sp-only { display: inline; }
    .pc-only { display: none; }

    /* Hero */
    .lp-hero {
        padding: calc(var(--header-h) + 48px) 0 56px;
    }

    .lp-hero-title {
        font-size: 1.875rem;
    }

    .lp-hero-desc {
        font-size: 0.95rem;
    }

    .lp-hero-cta {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 36px;
    }

    .lp-hero-cta .btn {
        justify-content: center;
    }

    .lp-hero-stats {
        width: 100%;
        padding: 16px 12px;
        border-radius: var(--radius-md);
    }

    .lp-hero-stat {
        padding: 0 12px;
    }

    .lp-hero-stat-value {
        font-size: 1.5rem;
    }

    /* Sections */
    .lp-section {
        padding: 56px 0;
    }

    .lp-section-title {
        font-size: 1.4rem;
    }

    .lp-section-desc {
        font-size: 0.875rem;
        margin-bottom: 32px;
    }

    /* Categories */
    .lp-categories {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .lp-category-card {
        padding: 16px 10px;
    }

    .lp-category-icon {
        width: 44px;
        height: 44px;
    }

    .lp-category-icon .lucide-icon {
        width: 20px;
        height: 20px;
    }

    .lp-category-name {
        font-size: 0.8rem;
    }

    /* Listings */
    .lp-listing-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Features */
    .lp-features {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Steps */
    .lp-steps {
        flex-direction: column;
        gap: 12px;
    }

    .lp-step-arrow {
        width: 100%;
        padding-top: 0;
        transform: rotate(90deg);
        height: 20px;
    }

    /* CTA */
    .lp-cta-box {
        padding: 48px 0;
    }

    .lp-cta-title {
        font-size: 1.4rem;
    }

    .lp-cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .lp-cta-buttons .btn {
        justify-content: center;
    }
}
