/* =========================
   Tools Page
========================= */

.tools-page {
    width: min(100% - 32px, 1000px);

    margin: 0 auto;

    padding: 40px 0 60px;
}


/* =========================
   Page Header
========================= */

.tools-page .page-header {
    margin-bottom: 30px;
}


/* =========================
   Search Section
========================= */

.tool-search {
    margin-bottom: 34px;

    padding: 24px;

    background:
        linear-gradient(
            135deg,
            rgba(51, 91, 60, 0.38),
            rgba(35, 35, 35, 0.9) 48%
        );

    border: 2px solid #416d4b;
    border-radius: 12px;

    box-shadow:
        0 7px 20px rgba(0, 0, 0, 0.25),
        0 0 14px rgba(106, 199, 125, 0.05);
}


/* =========================
   Search Header
========================= */

.search-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 18px;
}

.search-kicker {
    display: block;

    margin-bottom: 5px;

    color: #78d489;

    font-size: 9px;
    letter-spacing: 0.12em;
}

.search-header h2 {
    margin: 0;

    color: white;

    font-size: 19px;
}

.tool-count {
    flex-shrink: 0;

    padding: 7px 9px;

    background-color: rgba(51, 91, 60, 0.32);

    color: #9adba6;

    border: 1px solid #416d4b;
    border-radius: 6px;

    font-size: 8px;
    letter-spacing: 0.08em;
}


/* =========================
   Searchable Input
========================= */

.searchable-input {
    display: grid;
    grid-template-columns: 46px 1fr;
    align-items: center;

    overflow: hidden;

    width: 100%;

    background-color: #181a18;

    border: 1px solid #4d6552;
    border-radius: 9px;

    box-shadow:
        inset 0 2px 7px rgba(0, 0, 0, 0.24);

    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background-color 0.18s ease;
}

.searchable-input:focus-within {
    background-color: #1a1d1a;

    border-color: #6ac77d;

    box-shadow:
        inset 0 2px 7px rgba(0, 0, 0, 0.24),
        0 0 0 2px rgba(106, 199, 125, 0.08),
        0 0 10px rgba(106, 199, 125, 0.08);
}


/* =========================
   Search Icon
========================= */

.search-icon {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 46px;
    height: 46px;

    border-right: 1px solid #35453a;
}

.search-icon span {
    position: relative;

    box-sizing: border-box;

    width: 14px;
    height: 14px;

    border: 2px solid #78d489;
    border-radius: 50%;

    opacity: 0.8;
}

.search-icon span::after {
    content: "";

    position: absolute;

    right: -6px;
    bottom: -4px;

    width: 7px;
    height: 2px;

    background-color: #78d489;

    transform: rotate(45deg);
    transform-origin: left center;

    border-radius: 2px;
}


/* =========================
   Search Input
========================= */

.search-input {
    box-sizing: border-box;

    width: 100%;
    height: 46px;

    padding: 0 14px;

    background: transparent;

    color: white;

    border: none;
    outline: none;

    font-family: inherit;
    font-size: 12px;
}

.search-input::placeholder {
    color: #777b78;
}

.search-input::-webkit-search-cancel-button {
    cursor: pointer;
}


/* =========================
   Tool Directory
========================= */

.tools-directory {
    width: 100%;
}

.directory-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    margin-bottom: 14px;
}

.directory-label {
    display: block;

    margin-bottom: 5px;

    color: #78d489;

    font-size: 9px;
    letter-spacing: 0.12em;
}

.directory-header h2 {
    margin: 0;

    color: white;

    font-size: 19px;
}


/* =========================
   Tool List
========================= */

.tool-list {
    overflow: hidden;

    background-color: #202220;

    border: 1px solid #405044;
    border-radius: 12px;

    box-shadow:
        0 7px 20px rgba(0, 0, 0, 0.24);
}

.tool-list:empty {
    display: none;
}


/* =========================
   Tool Row
========================= */

.tool-row {
    --tool-accent: #6ac77d;
    --tool-accent-soft: rgba(106, 199, 125, 0.25);
    --tool-hover-bg: rgba(51, 91, 60, 0.28);
    --tool-icon-bg: rgba(58, 115, 72, 0.30);
    --tool-icon-dark: #1b231d;
    --tool-icon-border: #52785b;
    --tool-title: #9adba6;

    position: relative;

    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;

    gap: 18px;

    min-height: 88px;

    padding: 18px 20px;

    background:
        linear-gradient(
            90deg,
            rgba(51, 91, 60, 0.10),
            #252525 25%
        );

    color: white;

    text-decoration: none;

    border-bottom: 1px solid #38413a;

    transition:
        background 0.18s ease,
        box-shadow 0.18s ease;
}

.tool-row:last-child {
    border-bottom: none;
}


/* Small permanent marker */

.tool-row::before {
    content: "";

    position: absolute;

    left: 0;
    top: 22%;

    width: 2px;
    height: 56%;

    background-color: #4f805a;

    opacity: 0.7;

    transition:
        height 0.18s ease,
        top 0.18s ease,
        background-color 0.18s ease,
        box-shadow 0.18s ease;
}


/* =========================
   Tool Icon
========================= */

.tool-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 58px;
    height: 58px;

    background:
        linear-gradient(
            135deg,
            rgba(58, 115, 72, 0.22),
            rgba(25, 31, 26, 0.9)
        );

    border: 1px solid #405d47;
    border-radius: 9px;

    box-shadow:
        inset 0 0 10px rgba(120, 212, 137, 0.025);

    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}

.tool-row-icon {
    width: 42px;
    height: 42px;

    object-fit: contain;

    transform: translateZ(0);

    transition:
        transform 0.18s ease,
        filter 0.18s ease;
}


/* =========================
   Tool Content
========================= */

.tool-row-content {
    min-width: 0;
}

.tool-type {
    display: block;

    margin-bottom: 4px;

    color: #739079;

    font-size: 8px;
    letter-spacing: 0.1em;
}

.tool-row-content h3 {
    margin: 0 0 5px;

    color: #f3f3f3;

    font-size: 15px;

    transition:
        color 0.18s ease,
        text-shadow 0.18s ease;
}

.tool-row-content p {
    margin: 0;

    max-width: 650px;

    color: #a9aca9;

    font-size: 11px;
    line-height: 1.5;
}


/* =========================
   Arrow
========================= */

.arrow-img {
    box-sizing: border-box;

    width: 42px;
    height: 42px;

    padding: 10px;

    background-color: rgba(51, 91, 60, 0.35);

    border: 1px solid #416d4b;
    border-radius: 8px;

    object-fit: contain;

    transition:
        transform 0.18s ease,
        background-color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}


/* =========================
   Shared Hover
========================= */

.tool-row:hover {
    background:
        linear-gradient(
            90deg,
            var(--tool-hover-bg),
            #292929 34%
        );
}

.tool-row:hover::before {
    top: 12%;

    height: 76%;

    background-color: var(--tool-accent);

    box-shadow:
        0 0 7px var(--tool-accent-soft);
}

.tool-row:hover .tool-icon-container {
    transform: translateY(-1px);

    background:
        linear-gradient(
            135deg,
            var(--tool-icon-bg),
            var(--tool-icon-dark)
        );

    border-color: var(--tool-icon-border);
}

.tool-row:hover .tool-row-icon {
    transform: scale(1.08);
}

.tool-row:hover .tool-row-content h3 {
    color: var(--tool-title);

    text-shadow:
        0 0 6px var(--tool-accent-soft);
}

.tool-row:hover .arrow-img {
    transform: translateX(3px);

    background-color: var(--tool-hover-bg);

    border-color: var(--tool-accent);

    box-shadow:
        0 0 8px var(--tool-accent-soft);
}


/* =========================
   End Portal Theme
========================= */

.endportal-row {
    --tool-accent: #53bdb5;
    --tool-accent-soft: rgba(83, 189, 181, 0.28);

    --tool-hover-bg: rgba(57, 125, 121, 0.28);

    --tool-icon-bg: rgba(57, 125, 121, 0.30);
    --tool-icon-dark: #1b2322;
    --tool-icon-border: #397d79;

    --tool-title: #72d5ce;
}


/* =========================
   Nether Theme
========================= */

.nether-row {
    --tool-accent: #d15d70;
    --tool-accent-soft: rgba(209, 93, 112, 0.25);

    --tool-hover-bg: rgba(130, 45, 58, 0.28);

    --tool-icon-bg: rgba(130, 45, 58, 0.30);
    --tool-icon-dark: #251a1c;
    --tool-icon-border: #82404c;

    --tool-title: #e67888;
}


/* =========================
   Enchantment Theme
========================= */

.enchantment-row {
    --tool-accent: #a96bd8;
    --tool-accent-soft: rgba(169, 107, 216, 0.25);

    --tool-hover-bg: rgba(118, 80, 141, 0.30);

    --tool-icon-bg: rgba(118, 80, 141, 0.32);
    --tool-icon-dark: #211b26;
    --tool-icon-border: #76508d;

    --tool-title: #c79cff;
}


/* =========================
   Villager Theme
========================= */

.villager-row {
    --tool-accent: #4bd477;
    --tool-accent-soft: rgba(75, 212, 119, 0.25);

    --tool-hover-bg: rgba(63, 143, 91, 0.30);

    --tool-icon-bg: rgba(63, 143, 91, 0.32);
    --tool-icon-dark: #18271e;
    --tool-icon-border: #3f8f5b;

    --tool-title: #6fdd91;
}


/* =========================
   Material Planner Theme
========================= */

.material-row {
    --tool-accent: #d69a55;
    --tool-accent-soft: rgba(214, 154, 85, 0.25);

    --tool-hover-bg: rgba(138, 92, 48, 0.28);

    --tool-icon-bg: rgba(138, 92, 48, 0.30);
    --tool-icon-dark: #261e17;
    --tool-icon-border: #8a603b;

    --tool-title: #e2b477;
}


/* =========================
   Circle Generator Theme
========================= */

.circle-row {
    --tool-accent: #d26070;
    --tool-accent-soft: rgba(210, 96, 112, 0.25);

    --tool-hover-bg: rgba(135, 69, 78, 0.28);

    --tool-icon-bg: rgba(135, 69, 78, 0.30);
    --tool-icon-dark: #2a2022;
    --tool-icon-border: #87454e;

    --tool-title: #ed8794;
}


/* =========================
   No Results
========================= */

.no-results {
    margin-top: 18px;

    padding: 30px 20px;

    background:
        linear-gradient(
            135deg,
            rgba(51, 91, 60, 0.16),
            #222222
        );

    color: #8f938f;

    border: 1px solid #405044;
    border-radius: 10px;

    text-align: center;

    font-size: 11px;
    line-height: 1.6;
}

.no-results span {
    display: block;

    margin-bottom: 4px;

    color: #b9d4be;

    font-size: 13px;
}

.hidden {
    display: none;
}


/* =========================
   Mobile
========================= */

@media (max-width: 700px) {

    .tools-page {
        width: min(100% - 20px, 1000px);

        padding-top: 28px;
    }

    .tool-search {
        padding: 20px;
    }

    .tool-row {
        gap: 14px;

        min-height: 82px;

        padding: 16px 14px;
    }

    .tool-icon-container {
        width: 50px;
        height: 50px;
    }

    .tool-row-icon {
        width: 36px;
        height: 36px;
    }

    .tool-row-content h3 {
        font-size: 13px;
    }

    .tool-row-content p {
        font-size: 10px;
    }

    .arrow-img {
        width: 36px;
        height: 36px;

        padding: 8px;
    }

}


@media (max-width: 500px) {

    .search-header {
        align-items: flex-start;
    }

    .tool-count {
        display: none;
    }

    .tool-row {
        grid-template-columns: 50px 1fr;
    }

    .arrow-img {
        display: none;
    }

}