/*
 * AI SaaS Review Theme - Common Components
 * Version: 1.0.0
 * 
 * 通用组件样式，所有页面都需要
 */

/* ============================================================
   Hero / Search Section - Search-first Discovery
   ============================================================ */
.aisaas-hero {
    background: #f8fbff;
    padding: 48px 0 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Subtle background: faint grid + radial light */
.aisaas-hero__bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(circle at 15% 20%, rgba(26, 86, 219, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(14, 159, 110, 0.05) 0%, transparent 40%),
        linear-gradient(rgba(226, 232, 240, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(226, 232, 240, 0.3) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
}

.aisaas-hero .aisaas-container {
    position: relative;
    z-index: 1;
}

/* Trust badge */
.aisaas-hero__trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: var(--aisaas-primary);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.aisaas-hero__trust-badge svg {
    color: var(--aisaas-cta);
}

/* Title */
.aisaas-hero__title,
.aisaas-hero--discovery .aisaas-hero__title {
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin: 0 0 12px;
    position: relative;
    z-index: 1;
}

/* Subtitle */
.aisaas-hero__subtitle,
.aisaas-hero--discovery .aisaas-hero__subtitle {
    font-size: 1.0625rem;
    color: var(--aisaas-text-secondary);
    margin: 0 auto 28px;
    max-width: 600px;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* Stats bar */
.aisaas-hero__stats-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    padding: 14px 28px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    margin: 0 auto;
    max-width: 720px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.03);
    position: relative;
    z-index: 1;
}

.aisaas-hero__stat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
}

.aisaas-hero__stat-icon {
    color: var(--aisaas-primary);
    opacity: 0.6;
    flex-shrink: 0;
}

.aisaas-hero__stat-num {
    font-size: 1.0625rem;
    font-weight: 800;
    color: var(--aisaas-primary);
    letter-spacing: -0.02em;
}

.aisaas-hero__stat-label {
    font-size: 0.8125rem;
    color: var(--aisaas-text-secondary);
    font-weight: 600;
}

.aisaas-hero__stat-sep {
    width: 1px;
    height: 24px;
    background: var(--aisaas-border);
    flex-shrink: 0;
}

/* ============================================================
   Section Headings
   ============================================================ */
.aisaas-section {
    padding: var(--aisaas-space-2xl) 0;
}

.aisaas-section--gray {
    background: var(--aisaas-bg-secondary);
}

.aisaas-section--featured {
    background: linear-gradient(180deg, #f0f7ff 0%, #f8fafc 50%, #ffffff 100%);
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.aisaas-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--aisaas-space-xl);
}

.aisaas-section__title {
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.aisaas-section__desc {
    font-size: 0.9375rem;
    color: var(--aisaas-text-secondary);
    margin: 4px 0 0;
}

.aisaas-section__link {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--aisaas-primary);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.2s;
}

.aisaas-section__link:hover {
    gap: 8px;
}

/* ============================================================
   Search Box
   ============================================================ */
.aisaas-search {
    position: relative;
    max-width: 640px;
    margin: 0 auto var(--aisaas-space-xl);
}

.aisaas-search__input {
    width: 100%;
    padding: 16px 20px 16px 52px;
    border: 2px solid var(--aisaas-border);
    border-radius: var(--aisaas-radius-xl);
    font-size: 1rem;
    background: var(--aisaas-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.aisaas-search__input:focus {
    border-color: var(--aisaas-primary);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

.aisaas-search__input::placeholder {
    color: var(--aisaas-text-muted);
}

.aisaas-search__icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--aisaas-text-muted);
    pointer-events: none;
}

.aisaas-search__icon svg {
    width: 20px;
    height: 20px;
}

/* ============================================================
   Tabs
   ============================================================ */
.aisaas-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: var(--aisaas-space-lg);
    border-bottom: 2px solid var(--aisaas-border-light);
}

.aisaas-tab {
    padding: 12px 24px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--aisaas-text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all 0.2s;
}

.aisaas-tab:hover {
    color: var(--aisaas-primary);
}

.aisaas-tab.is-active {
    color: var(--aisaas-primary);
    border-bottom-color: var(--aisaas-primary);
}

.aisaas-tab-panel {
    display: none;
}

.aisaas-tab-panel.is-active {
    display: block;
}

/* ============================================================
   Tool List Layout
   ============================================================ */
.aisaas-tool-list {
    display: grid;
    gap: var(--aisaas-space-lg);
}

.aisaas-tool-list--grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* ============================================================
   Grid System
   ============================================================ */
.aisaas-grid {
    display: grid;
    gap: var(--aisaas-space-lg);
}

.aisaas-grid--2 { grid-template-columns: repeat(2, 1fr); }
.aisaas-grid--3 { grid-template-columns: repeat(3, 1fr); }
.aisaas-grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .aisaas-grid--2,
    .aisaas-grid--3,
    .aisaas-grid--4 {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Utility Classes
   ============================================================ */
.is-hidden { display: none !important; }
.is-visible { display: block !important; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
