/* ToolSparkr Homepage Styles */

/* Hero Section */
.ts-hero {
    background: #ffffff;
    padding: 4.5rem 0 3rem;
}

[data-theme-style="dark"] .ts-hero {
    background: var(--gray-50);
}

.ts-hero-title {
    font-size: 3.25rem;
    font-weight: 800;
    color: #2563EB;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.ts-hero-subtitle {
    font-size: 1.2rem;
    color: #64748B;
    max-width: 550px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
}

/* Search Bar */
.ts-search-wrapper {
    position: relative;
}

.ts-search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
    font-size: 1rem;
    z-index: 2;
    pointer-events: none;
}

.ts-search-input {
    padding: 0.95rem 1.25rem 0.95rem 3.25rem !important;
    font-size: 1.05rem !important;
    border: 2px solid #E2E8F0 !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05) !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
    height: auto !important;
}

.ts-search-input:focus {
    border-color: #2563EB !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12) !important;
    outline: none !important;
}

/* Tools Section */
.ts-tools-section {
    background: #F8FAFC;
    padding: 2.5rem 0 4rem;
}

[data-theme-style="dark"] .ts-tools-section {
    background: var(--body-bg);
}

/* Category Group */
.ts-category-group {
    margin-bottom: 2.5rem;
}

.ts-category-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #E2E8F0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.ts-category-title:hover {
    color: #2563EB;
    border-bottom-color: #2563EB;
}

.ts-category-title i {
    color: #2563EB;
    font-size: 0.95rem;
    transition: transform 0.2s ease;
}

.ts-category-title:hover i {
    transform: scale(1.15);
}

[data-theme-style="dark"] .ts-category-title {
    color: var(--gray-800);
    border-color: var(--gray-200);
}

[data-theme-style="dark"] .ts-category-title:hover {
    color: #60A5FA;
}

/* Tool Card */
.ts-tool-card {
    display: flex;
    align-items: center;
    padding: 1.1rem 1.25rem;
    background: #ffffff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    text-decoration: none !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    height: 100%;
}

.ts-tool-card:hover {
    border-color: #2563EB;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.15);
    transform: translateY(-4px) scale(1.02);
}

.ts-tool-card:hover .ts-tool-icon {
    background: #2563EB;
    color: #fff;
}

.ts-tool-card:hover .ts-tool-name {
    color: #2563EB;
}

[data-theme-style="dark"] .ts-tool-card {
    background: var(--gray-100);
    border-color: var(--gray-200);
}

[data-theme-style="dark"] .ts-tool-card:hover {
    border-color: #2563EB;
}

.ts-tool-disabled {
    opacity: 0.45;
    pointer-events: none;
}

/* Tool Icon */
.ts-tool-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 10px;
    background: #EFF6FF;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    color: #2563EB;
    font-size: 1rem;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

[data-theme-style="dark"] .ts-tool-icon {
    background: var(--gray-200);
}

/* Tool Info */
.ts-tool-name {
    font-weight: 600;
    color: #1E293B;
    font-size: 0.92rem;
    margin-bottom: 0.1rem;
    line-height: 1.3;
    transition: color 0.25s ease;
}

[data-theme-style="dark"] .ts-tool-name {
    color: var(--gray-800);
}

.ts-tool-desc {
    color: #64748B;
    font-size: 0.8rem;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}

/* Viewport fade-in animation for tool cards */
@keyframes tsFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ts-tool-animate {
    opacity: 0;
}

.ts-tool-animate.ts-visible {
    animation: tsFadeInUp 0.4s ease forwards;
}

/* How It Works Section */
.ts-howitworks-section {
    background: #EFF6FF;
    padding: 2.5rem 0;
    border-bottom: 1px solid #DBEAFE;
}

[data-theme-style="dark"] .ts-howitworks-section {
    background: var(--gray-100);
    border-color: var(--gray-200);
}

.ts-step-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: #2563EB;
    color: #fff;
    font-size: 1.5rem;
}

.ts-step-number {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1E3A8A;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* FAQ section reuse */
.index-faq svg {
    transition: all .15s;
    color: var(--primary-800);
}

/* Scroll-to-top button */
.ts-scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #2563EB;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.2s ease;
    z-index: 999;
}

.ts-scroll-top.ts-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ts-scroll-top:hover {
    background: #1D4ED8;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    transform: translateY(-2px);
}

@media (max-width: 767px) {
    .ts-hero-title {
        font-size: 2.25rem;
    }

    .ts-hero-subtitle {
        font-size: 1.05rem;
    }

    /* Tool description: allow wrapping on mobile.
       Desktop uses max-width + ellipsis for compact card layout.
       Mobile (Google crawls mobile first): must show full text — no truncation. */
    .ts-tool-desc {
        max-width: 100%;
        white-space: normal;
        text-overflow: clip;
        overflow: visible;
    }

    /* Hero search input — ensure 16px to prevent iOS zoom */
    .ts-search-input {
        font-size: 16px !important;
    }

    .ts-scroll-top {
        bottom: 1.25rem;
        right: 1.25rem;
        width: 40px;
        height: 40px;
    }

    /* Scroll-to-top: maintain 48px tap target even at smaller visual size */
    .ts-scroll-top {
        min-width: 44px;
        min-height: 44px;
    }
}
