/* ============================================================
   Quick Generate (public /generate) page
   iLovePDF-style tool grid: fixed-width cards that wrap and
   left-align, so a sparse category does not stretch full width.
   ============================================================ */

/* The layout wraps content in `.waterfall-container py-lg-5 py-3`, leaving a tall
   white gap above. Pull the gray page up to absorb that padding. */
.qgi-page {
    background: #f6f7f9;
    min-height: 100vh;
    margin-top: -1rem;
}
@media (min-width: 992px) {
    .qgi-page { margin-top: -3rem; }
}
.qgi-page * { box-sizing: border-box; }

/* Centered title + search + pills */
.qgi-hero {
    text-align: center;
    padding: 1.5rem 1rem 1.25rem;
}
.qgi-title {
    font-size: 2rem;
    font-weight: 800;
    color: #1a2b4a;
    letter-spacing: -0.5px;
    margin: 0 0 1.5rem;
}

/* Search stays centered; Check Invoice sits on the right of the same line */
.qgi-searchrow {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qgi-search {
    position: relative;
    width: 100%;
    max-width: 560px;
}
.qgi-check {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
}
@media (max-width: 767px) {
    .qgi-searchrow { flex-direction: column; gap: 0.75rem; }
    .qgi-check { position: static; transform: none; }
}
.qgi-search input {
    width: 100%;
    height: 54px;
    padding: 0 22px;
    font-size: 0.95rem;
    border-radius: 999px;
    text-align: center;
    border: 1px solid #e3e6ea;
    background: #fff;
    box-shadow: 0 2px 10px rgba(16, 24, 40, 0.05);
    transition: all 0.15s;
}
.qgi-search input:focus {
    outline: none;
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 4px rgba(var(--theme-primary-rgb), 0.10);
}

.qgi-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 1.5rem auto 0;
}
.qgi-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #5b6472;
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 999px;
    padding: 0.5rem 1.05rem;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.qgi-tab:hover {
    border-color: var(--theme-primary);
    color: var(--theme-primary);
}
.qgi-tab.active {
    background: var(--theme-primary);
    border-color: var(--theme-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(var(--theme-primary-rgb), 0.25);
}
.qgi-tab.active .qgi-tab-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}
.qgi-tab-count {
    background: #f1f3f5;
    color: #6b7280;
    font-size: 10px;
    font-weight: 700;
    border-radius: 999px;
    padding: 1px 7px;
}

/* Section heading */
.qgi-cat-section { margin-bottom: 2.75rem; }
.qgi-cat-head {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a2b4a;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 1.25rem;
}
.qgi-cat-ico {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(var(--theme-primary-rgb), 0.08);
    color: var(--theme-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Tool grid: fixed-width columns, wrap, left-aligned (iLovePDF behaviour) */
.qgi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 14.5rem));
    justify-content: start;
    gap: 1rem;
}
@media (max-width: 575px) {
    .qgi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    .qgi-title { font-size: 1.4rem; margin-bottom: 1.1rem; }
}

/* Tool card */
.qgi-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 178px;
    background: #fff;
    border: 1px solid #ebedf0;
    border-radius: 12px;
    padding: 1.25rem;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.qgi-card:hover {
    box-shadow: 0 14px 32px rgba(16, 24, 40, 0.13);
    transform: translateY(-5px);
    border-color: #fff;
}
.qgi-ico {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.85rem;
}
.qgi-ico svg,
.qgi-ico i { width: 24px; height: 24px; stroke-width: 2; }
.qgi-ico.is-free { background: rgba(58, 143, 25, 0.10); }
.qgi-ico.is-free svg { stroke: #16a34a; }
.qgi-ico.is-premium { background: rgba(44, 83, 169, 0.10); }
.qgi-ico.is-premium svg { stroke: #2c53a9; }
.qgi-ico.is-paid { background: rgba(245, 158, 11, 0.12); }
.qgi-ico.is-paid svg { stroke: #d97706; }

.qgi-svc-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a2b4a;
    margin-bottom: 0.35rem;
    line-height: 1.3;
}
.qgi-svc-desc {
    font-size: 0.8rem;
    color: #7b8494;
    line-height: 1.45;
    margin: 0 0 0.85rem;
    flex: 1;
}
.qgi-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--theme-primary);
    margin-top: auto;
    opacity: 0.85;
}
.qgi-cta svg { width: 15px; height: 15px; transition: transform 0.15s; }
.qgi-card:hover .qgi-cta { opacity: 1; }
.qgi-card:hover .qgi-cta svg { transform: translateX(4px); }

.qgi-badge {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
    border-radius: 999px;
    padding: 3px 10px;
}
.qgi-badge.is-free { background: #eaf6e6; color: #2f7a14; }
.qgi-badge.is-premium { background: #e8edf8; color: #2c53a9; }
.qgi-badge.is-paid { background: #fdf0d9; color: #b45309; }

/* Empty / no-results */
.qgi-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #7b8494;
}
.qgi-empty .qgi-empty-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1a2b4a;
    margin: 0.5rem 0 0.25rem;
}
.qgi-empty p { font-size: 0.85rem; margin: 0; }
