/* ============================================
   AI TOOLCOR CALCULATORS — INDEX PAGE STYLES
   style.css · v3.0 · Light Theme
   ============================================ */

/* ===== HERO ===== */
.hero {
    padding: calc(var(--nav-h) + 56px) 24px 52px;
    background: var(--grad-hero);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 55% 45% at 20% 80%, rgba(124,58,237,0.07) 0%, transparent 70%),
        radial-gradient(ellipse 50% 50% at 80% 20%, rgba(14,165,233,0.07) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(124,58,237,0.1);
    color: var(--primary);
    border: 1px solid rgba(124,58,237,0.2);
    border-radius: var(--r-full);
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 22px;
    letter-spacing: 0.02em;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 900;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.03em;
}

.hero p {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

/* Hero Stats */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 32px;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 16px 24px;
    min-width: 90px;
    box-shadow: var(--shadow-sm);
    transition: var(--t);
}

.hero-stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.stat-number {
    font-size: 1.4rem;
    font-weight: 900;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ===== SEARCH ===== */
.search-section {
    max-width: 600px;
    margin: -20px auto 0;
    padding: 0 24px 32px;
    position: relative;
    z-index: 10;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 18px;
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 2;
    transition: color 0.2s;
}

.search-wrapper:focus-within .search-icon {
    color: var(--primary);
}

#searchInput {
    width: 100%;
    padding: 15px 48px 15px 46px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--r-full);
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 500;
    color: var(--text-primary);
    outline: none;
    transition: var(--t);
    box-shadow: var(--shadow-sm);
}

#searchInput:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(124,58,237,0.1), var(--shadow-md);
}

#searchInput::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.search-clear {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 6px;
    border-radius: 50%;
    opacity: 0;
    visibility: hidden;
    transition: var(--t);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-clear.visible {
    opacity: 1;
    visibility: visible;
}

.search-clear:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.search-hint {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 10px;
}

.search-hint kbd {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.7rem;
    font-family: inherit;
    color: var(--text-secondary);
}

/* ===== SECTIONS ===== */
.section {
    max-width: var(--container);
    margin: 0 auto 48px;
    padding: 0 24px;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.section.in-view {
    opacity: 1;
    transform: translateY(0);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
}

.section-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.section-header h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    letter-spacing: -0.02em;
}

.tool-count {
    font-size: 0.72rem;
    background: var(--primary-subtle);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* Category colours */
.bg-finance  { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.bg-health   { background: linear-gradient(135deg, #10b981, #059669); }
.bg-daily    { background: linear-gradient(135deg, #f59e0b, #d97706); }
.bg-business { background: linear-gradient(135deg, #0ea5e9, #0284c7); }

/* ===== TOOL GRID ===== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* ===== TOOL CARD ===== */
.tool-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px;
    text-decoration: none;
    transition: var(--t);
    box-shadow: var(--shadow-xs);
    position: relative;
    overflow: hidden;
}

.tool-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--grad-primary);
    opacity: 0;
    transition: opacity 0.25s var(--ease);
    pointer-events: none;
    border-radius: inherit;
}

.tool-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.tool-card:hover::after {
    opacity: 0.03;
}

.tool-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: #fff;
    flex-shrink: 0;
    transition: transform 0.25s var(--ease);
    box-shadow: var(--shadow-xs);
}

.tool-card:hover .tool-card-icon {
    transform: scale(1.08) rotate(-3deg);
}

.tool-card-content {
    flex: 1;
    min-width: 0;
}

.tool-card-content h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-card-content p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-card .arrow {
    color: var(--text-muted);
    font-size: 0.8rem;
    flex-shrink: 0;
    transition: transform 0.25s var(--ease), color 0.25s;
}

.tool-card:hover .arrow {
    color: var(--primary);
    transform: translateX(4px);
}

/* ===== FEATURES SECTION ===== */
.features-section {
    max-width: var(--container);
    margin: 0 auto 48px;
    padding: 56px 24px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.features-section.in-view {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    text-align: center;
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.section-sub {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 40px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    max-width: 960px;
    margin: 0 auto;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 28px 24px;
    text-align: center;
    transition: var(--t);
    box-shadow: var(--shadow-xs);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.feature-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    margin: 0 auto 16px;
    box-shadow: var(--shadow-sm);
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* ===== NO RESULTS ===== */
.no-results {
    display: none;
    text-align: center;
    padding: 64px 24px;
    color: var(--text-muted);
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.3;
    display: block;
}

.no-results h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.no-results p {
    font-size: 0.875rem;
}

/* ===== CTA SECTION ===== */
.cta-section {
    max-width: var(--container);
    margin: 0 auto 48px;
    padding: 0 24px;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.cta-section.in-view {
    opacity: 1;
    transform: translateY(0);
}

.cta-box {
    background: var(--grad-primary);
    border-radius: var(--r-xl);
    padding: 52px 40px;
    text-align: center;
    box-shadow: var(--shadow-lg), 0 0 40px rgba(124,58,237,0.15);
    position: relative;
    overflow: hidden;
}

.cta-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 60% at 20% 50%, rgba(255,255,255,0.08) 0%, transparent 70%),
        radial-gradient(ellipse 50% 60% at 80% 50%, rgba(255,255,255,0.05) 0%, transparent 70%);
    pointer-events: none;
}

.cta-box h2 {
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 800;
    color: #fff;
    margin-bottom: 10px;
    position: relative;
    letter-spacing: -0.02em;
}

.cta-box h2 .gradient-text {
    background: linear-gradient(135deg, #fde68a, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cta-box p {
    color: rgba(255,255,255,0.82);
    font-size: 0.95rem;
    margin-bottom: 28px;
    position: relative;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.95rem;
    padding: 13px 28px;
    border-radius: var(--r-full);
    transition: var(--t);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    position: relative;
    text-decoration: none;
}

.cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    color: var(--primary-dark);
}

/* ===== ANIMATE-UP (initial state before in-view) ===== */
.animate-up {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}

.animate-up.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero { padding: calc(var(--nav-h) + 32px) 16px 36px; }
    .hero-stats { gap: 6px; }
    .hero-stat { padding: 12px 16px; min-width: 72px; }
    .stat-number { font-size: 1.1rem; }

    .search-section { padding: 0 16px 24px; }

    .section { padding: 0 16px; margin-bottom: 36px; }
    .features-section { padding: 40px 16px; }
    .cta-section { padding: 0 16px; }
    .cta-box { padding: 36px 24px; }

    .tools-grid { grid-template-columns: 1fr; gap: 12px; }
    .features-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
}

@media (max-width: 480px) {
    .hero-stats { gap: 6px; }
    .hero-stat { padding: 10px 12px; min-width: 64px; }
    .features-grid { grid-template-columns: 1fr; }
    .tool-card { padding: 16px; }
    .tool-card-icon { width: 42px; height: 42px; font-size: 1rem; }
    .section-header { gap: 10px; }
    .section-icon { width: 38px; height: 38px; font-size: 0.95rem; }
    .section-header h2 { font-size: 1.15rem; }
}