/* =====================================================
   All Tools page (homepage-matching design, live since 2026-10-04)
   Used only by app/Views/pages/all-tools.php.

   Loaded AFTER home.css: reuses the homepage's tokens and building
   blocks (.hv1 colours, .hv1-hero, .hv1-tool cards, .hv1-cta ...), so
   changing those in home.css changes this page too, on purpose. This
   file only adds the .at-* parts: centred hero with a filter box, the
   category chip panel over the hero edge, and the per-category groups.
   ===================================================== */

/* Filtered-out cards and groups. Needed because .hv1-tool sets
   display:flex, which would otherwise beat the browser's [hidden] rule. */
.at [hidden] { display: none !important; }

/* ---------- Hero ---------- */
.at .hv1-hero { padding: 64px 0 150px; }

.at-crumbs ol {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin: 0 0 1.25rem;
    padding: 0;
    list-style: none;
    color: #94A3B8;
    font-size: 0.875rem;
}

.at-crumbs li + li::before {
    content: "/";
    margin-right: 0.4rem;
    opacity: 0.5;
}

.at-crumbs a { color: #CBD5E1; }
.at-crumbs a:hover { color: #fff; }
.at-crumbs [aria-current] { color: #fff; font-weight: 500; }

.at .hv1-lead { max-width: 760px; }

/* Filter box: same shape as the homepage search. */
.at-filter {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    max-width: 680px;
    margin: 2.25rem auto 0;
    padding: 0.5rem 0.5rem 0.5rem 1.1rem;
    border-radius: 18px;
    background: #fff;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 0 0 8px rgba(59, 130, 246, 0.14),
        0 30px 60px -20px rgba(0, 0, 0, 0.7);
    text-align: left;
    transition: box-shadow 0.25s ease;
}

.at-filter:focus-within {
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.2),
        0 0 0 8px rgba(59, 130, 246, 0.35),
        0 30px 60px -20px rgba(0, 0, 0, 0.7);
}

.at-filter > i { color: #8391A7; }

.at-filter input {
    flex: 1;
    min-width: 0;
    padding: 0.85rem 0.2rem;
    border: 0;
    outline: none;
    background: transparent;
    color: #0F172A;
    font-size: 1.063rem;
}

.at-filter input::placeholder { color: #8391A7; }

.at-count {
    padding: 0.55rem 0.9rem;
    border-radius: 12px;
    background: #F1F5F9;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ---------- Category chips, overlapping the hero edge ---------- */
.at-chips-wrap {
    position: relative;
    z-index: 2;
    margin-top: -84px;
}

.at-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem;
    border: 1px solid var(--hv1-border);
    border-radius: 22px;
    background: var(--hv1-surface);
    box-shadow: var(--hv1-shadow-lg);
}

.at-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.6rem 0.55rem 0.9rem;
    border: 1px solid var(--hv1-border);
    border-radius: 999px;
    background: var(--hv1-surface);
    color: var(--hv1-text);
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.at-chip > i { color: var(--c); }

.at-chip:hover {
    border-color: color-mix(in srgb, var(--c) 50%, var(--hv1-border));
    background: color-mix(in srgb, var(--c) 8%, transparent);
    transform: translateY(-1px);
}

.at-chip-count {
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: var(--hv1-surface-2);
    color: var(--hv1-muted);
    font-size: 0.75rem;
}

.at-chip[aria-pressed="true"] {
    border-color: transparent;
    background: var(--c);
    color: #fff;
}

.at-chip[aria-pressed="true"] > i { color: #fff; }

.at-chip[aria-pressed="true"] .at-chip-count {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

/* ---------- Category groups ---------- */
.at-groups { padding-top: 24px; }

.at-group { padding-top: 56px; }

.at-group-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-bottom: 1.4rem;
}

.at-group-icon {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--c) 14%, transparent);
    color: var(--c);
    font-size: 1.2rem;
}

.at-group-title {
    margin: 0;
    color: var(--hv1-text);
    font-size: clamp(1.35rem, 1.1rem + 0.8vw, 1.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.at-group-sub {
    margin: 0.15rem 0 0;
    color: var(--hv1-muted);
    font-size: 0.9rem;
}

.at-group-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-left: auto;
    color: var(--c);
    font-size: 0.9rem;
    font-weight: 600;
}

.at-group-link:hover { color: var(--c); }
.at-group-link i { transition: transform 0.2s ease; }
.at-group-link:hover i { transform: translateX(4px); }

.at-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.at-grid .hv1-tool { padding: 1.4rem; }
.at-grid .hv1-tool-icon { margin-bottom: 1rem; }

.at-empty {
    margin-top: 56px;
    padding: 3rem 1.5rem;
    border: 1px dashed var(--hv1-border);
    border-radius: 20px;
    color: var(--hv1-muted);
    text-align: center;
}

.at-empty i {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--hv1-blue);
    font-size: 1.8rem;
}

.at-empty h2 {
    margin: 0 0 0.4rem;
    color: var(--hv1-text);
    font-size: 1.25rem;
    font-weight: 700;
}

.at-empty p { margin: 0; }

.at-empty button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--hv1-blue);
    font-weight: 600;
}

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
    .at-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 991px) {
    .at-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .at .hv1-hero { padding: 48px 0 130px; }

    /* Chips scroll sideways instead of wrapping into a tall block. */
    .at-chips {
        flex-wrap: nowrap;
        justify-content: flex-start;
        padding: 0.6rem;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .at-chips::-webkit-scrollbar { display: none; }
    .at-group { padding-top: 40px; }
    .at-group-link { margin-left: 0; width: 100%; }
}

@media (max-width: 575px) {
    .at-grid { grid-template-columns: 1fr; gap: 0.6rem; }
    .at-grid .hv1-tool { padding: 1rem 1.1rem; }
    .at-grid .hv1-tool-icon { margin: 0; }
    .at-count { display: none; }
}
