/**
 * home.css
 * Homepage card catalog with search and category filtering.
 * 
 * @since 5.0.0
 */

/* Hero / intro section on homepage */
.home-hero {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 40px;
}

.home-hero h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--color-text);
}

.home-hero .tools-count {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--color-primary);
    color: #fff;
    margin-bottom: 16px;
}

.home-hero p {
    font-size: 16px;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* Search bar */
.tools-search {
    max-width: 480px;
    margin: 0 auto 36px;
    position: relative;
}

.tools-search input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    font-size: 16px;
    border: 2px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-bg-secondary);
    color: var(--color-text);
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.tools-search input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.tools-search input::placeholder {
    color: var(--color-text-secondary);
    opacity: 0.7;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--color-text-secondary);
    pointer-events: none;
}

/* Category sections */
.tools-category {
    margin-bottom: 40px;
}

.tools-category.hidden {
    display: none;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-border);
}

.category-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

.category-count {
    font-size: 13px;
    color: var(--color-text-secondary);
    font-weight: 400;
}

/* Card grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Individual card */
.tool-card {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

.tool-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 16px var(--color-shadow);
    transform: translateY(-2px);
}

.tool-card.hidden {
    display: none;
}

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.card-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
}

.card-badge-new {
    background: #16a34a;
    color: #fff;
}

.card-icon {
    width: 20px;
    height: 20px;
    color: var(--color-text-secondary);
    opacity: 0.6;
}

.tool-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
    line-height: 1.3;
}

.tool-card p {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.5;
    flex-grow: 1;
}

/* No results message */
.no-results {
    display: none;
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-secondary);
    font-size: 16px;
}

.no-results.visible {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .home-hero h1 {
        font-size: 24px;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
