/* =========================================================
   BDGoldPrice
   Tool Categories
   Light / Dark Theme Safe
   ========================================================= */

#tool-categories {
    width: 100%;
    margin: 0 auto;
    padding: 32px 0;
}

.tools-categories {
    width: min(100% - 32px, 1120px);
    margin: 0 auto;
}

.tools-categories-header {
    margin-bottom: 22px;
}

.tools-categories-title {
    margin: 0 0 6px;
    font-size: 28px;
    line-height: 1.25;
    font-weight: 700;
    color: var(--text-primary, #172033);
}

.tools-categories-description {
    margin: 0;
    max-width: 680px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary, #526174);
}

.tools-categories-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.tool-category-card {
    min-width: 0;
    height: 100%;
}

.tool-category-link {
    display: flex;
    align-items: flex-start;
    gap: 14px;

    min-height: 150px;
    height: 100%;

    box-sizing: border-box;
    padding: 20px;

    text-decoration: none;

    border: 1px solid var(--border-color, #dfe3e8);
    border-radius: 0;

    /* LIGHT MODE DEFAULT */
    background: #ffffff;

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

/* =========================================================
   LIGHT MODE HOVER
   IMPORTANT:
   Prevents cards from becoming black on hover.
   ========================================================= */

html[data-theme="light"] .tool-category-link:hover,
.tool-category-link:hover {
    transform: translateY(-3px);

    border-color: var(--color-primary, #2563eb);

    background: #ffffff;

    box-shadow:
        0 8px 24px rgba(37, 99, 235, 0.10);
}

/* =========================================================
   DARK MODE
   ========================================================= */

html[data-theme="dark"] .tool-category-link {
    background: #191e26;
    border-color: #2a3038;
}

html[data-theme="dark"] .tool-category-link:hover {
    background: #1d232c;
    border-color: var(--color-primary, #d4af37);

    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.25);
}

/* =========================================================
   FOCUS
   ========================================================= */

.tool-category-link:focus-visible {
    outline: 2px solid var(--color-primary, #2563eb);
    outline-offset: 3px;
}

html[data-theme="dark"] .tool-category-link:focus-visible {
    outline-color: var(--color-primary, #d4af37);
}

/* =========================================================
   ICON
   ========================================================= */

.tool-category-icon {
    flex: 0 0 44px;

    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 0;

    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.20);

    color: var(--color-primary, #2563eb);

    font-size: 15px;
    font-weight: 700;
    line-height: 1;
}

/* =========================================================
   DARK MODE ICON
   ========================================================= */

html[data-theme="dark"] .tool-category-icon {
    background: rgba(212, 175, 55, 0.12);
    border-color: rgba(212, 175, 55, 0.30);
    color: var(--color-primary, #d4af37);
}

/* =========================================================
   CONTENT
   ========================================================= */

.tool-category-content {
    min-width: 0;

    display: flex;
    flex-direction: column;

    height: 100%;
}

.tool-category-title {
    margin: 0 0 7px;

    font-size: 17px;
    line-height: 1.35;
    font-weight: 700;

    color: var(--text-primary, #172033);
}

.tool-category-description {
    margin: 0;

    font-size: 13px;
    line-height: 1.55;

    color: var(--text-secondary, #526174);
}

/* =========================================================
   DARK MODE TEXT
   ========================================================= */

html[data-theme="dark"] .tool-category-title {
    color: #f5f7fa;
}

html[data-theme="dark"] .tool-category-description {
    color: #d1d5db;
}

/* =========================================================
   COUNT
   ========================================================= */

.tool-category-count {
    display: inline-flex;
    align-items: center;

    width: fit-content;

    margin-top: auto;
    padding-top: 14px;

    font-size: 12px;
    line-height: 1;
    font-weight: 600;

    color: var(--color-primary, #2563eb);
}

html[data-theme="dark"] .tool-category-count {
    color: var(--color-primary, #d4af37);
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

    .tools-categories-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    #tool-categories {
        padding: 24px 0;
    }

    .tools-categories {
        width:
            min(100% - 24px, 1120px);
    }

    .tools-categories-title {
        font-size: 23px;
    }

    .tools-categories-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .tool-category-link {
        min-height: 120px;
        padding: 16px;
    }

}