/* ==========================================================================
   File: Tool/tools.css
   KHALA STUDIO — TOOLS MODULE (RESOURCE HUB VIBE MATCH)
   Vibe: Apple + Google, Simple, Easy, Modern, Fast, Clean, No stress
   ========================================================================== */

.tools-main-wrapper {
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 var(--hub-page-pad) !important;
    box-sizing: border-box !important;
    background: var(--hub-bg);
    color: var(--hub-text);
    font-family: var(--hub-font);
    font-size: 1rem;
}

.tools-main-wrapper *,
.tools-main-wrapper h1,
.tools-main-wrapper h2,
.tools-main-wrapper h3,
.tools-main-wrapper h4,
.tools-main-wrapper p,
.tools-main-wrapper button,
.tools-main-wrapper input {
    box-sizing: border-box;
    font-family: inherit;
}

/* --------------------------------------------------------------------------
   Header & Search Shell (60px Round Shell)
   -------------------------------------------------------------------------- */
.tools-header-row {
    display: block;
    width: 100%;
    margin: 50px 0 22px;
}

.tools-header-actions {
    width: 100%;
    margin-top: 24px;
}

.tools-search-shell {
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    background: var(--hub-soft);
    border-radius: 32px;
    overflow: hidden;
    transition: background-color .18s ease;
}

.tools-search-shell:focus-within {
    background: var(--hub-soft-hover);
}

.tools-search-all {
    height: 100%;
    min-width: 120px;
    padding: 0 28px 0 42px;
    border: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--hub-title);
    font-size: 1rem;
    font-weight: 400;
    cursor: pointer;
    position: relative;
}

.tools-search-all::after {
    content: "";
    position: absolute;
    right: 0;
    top: 16px;
    width: 1px;
    height: 28px;
    background: var(--hub-border);
}

.tools-search-all .material-symbols-outlined {
    font-size: 22px;
    font-variation-settings: 'wght' 400;
}

.tools-search-all-label {
    position: relative;
    padding-bottom: 4px;
}

.tools-search-all.is-active .tools-search-all-label::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -14px;
    height: 2px;
    border-radius: 1px;
    background: var(--hub-accent);
}

.tools-search-input-wrap {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 20px 0 22px;
}

.tools-search-input-wrap .material-symbols-outlined {
    color: var(--hub-text);
    font-size: 28px;
    flex: 0 0 auto;
}

.tools-search-input {
    width: 100%;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--hub-title);
    font: inherit;
    font-size: 1.125rem;
}

.tools-search-input::placeholder {
    color: #a9a9b3;
    opacity: 1;
}

.tools-search-submit {
    width: 70px;
    height: 100%;
    border: 0;
    background: transparent;
    color: var(--hub-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color .18s ease;
}

.tools-search-submit:hover {
    color: var(--hub-accent);
}

.tools-search-submit .material-symbols-outlined {
    font-size: 34px;
}

/* --------------------------------------------------------------------------
   Tools Category Grid (Aspect Ratio: 1.275 / 1)
   -------------------------------------------------------------------------- */
.tools-category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--hub-gap);
    width: 100%;
}

.tool-cat-card {
    min-width: 0;
    aspect-ratio: 1.275 / 1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    background: var(--hub-soft) !important;
    border-radius: var(--hub-radius) !important;
    border: 0;
    cursor: pointer;
    text-align: center;
    transition: background-color .18s ease;
}

.tool-cat-card:focus-visible {
    outline: 2px solid var(--hub-accent);
    outline-offset: 3px;
}

.tool-cat-icon-wrap {
    width: 100%;
    flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    background: var(--hub-soft);
}

.tool-cat-icon-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.12);
    opacity: 0;
    transition: opacity .18s ease;
    pointer-events: none;
}

.tool-cat-card:hover .tool-cat-icon-wrap::after {
    opacity: 1;
}

.tool-cat-icon-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    object-position: center;
    transition: opacity .18s ease;
}

/* Dynamic SVG/Material Icon Fallback Container */
.tool-cat-icon-inner {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: rgba(26, 115, 232, 0.12);
    color: var(--hub-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-cat-icon-inner .material-symbols-outlined {
    font-size: 36px;
}

.tool-cat-label {
    width: 100%;
    min-height: 54px;
    padding: 14px 16px 15px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    background: var(--hub-soft);
    color: var(--hub-text) !important;
    font-size: 1rem !important;
    line-height: 1.15;
    font-weight: 500 !important;
    letter-spacing: -0.01em;
}

.tools-empty-state {
    grid-column: 1 / -1;
    min-height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hub-text);
    font-size: 1.125rem;
    background: var(--hub-soft);
    border-radius: var(--hub-radius);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1000px) {
    .tools-category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .tools-header-row {
        margin-top: 48px;
    }

    .tools-search-shell {
        height: 54px;
    }

    .tools-search-all {
        min-width: 78px;
        padding: 0 12px;
        gap: 7px;
        font-size: 1rem;
    }

    .tools-search-all::after {
        top: 14px;
        height: 26px;
    }

    .tools-search-input-wrap {
        padding: 0 10px 0 14px;
        gap: 8px;
    }

    .tools-search-input {
        font-size: 1rem;
    }

    .tools-search-submit {
        width: 52px;
    }

    .tools-search-submit .material-symbols-outlined {
        font-size: 28px;
    }

    .tools-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tool-cat-label {
        min-height: 46px;
        padding: 11px 12px;
        font-size: 1rem !important;
    }
}

@media (max-width: 420px) {
    .tools-search-all span:last-child {
        display: none;
    }

    .tools-search-all {
        min-width: 52px;
        padding: 0 14px;
    }
}