/* Trader Tools — index / show / compare
   White cards on purple gradient page bg. Dark text inside cards.
   Tokens (matching tokens.css): surface #fff, text-primary #1a1a2e, text-mid #555, brand #6366f1.
*/

/* ===== HERO (index) ===== */
.tools-hero {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.08);
    text-align: center;
    margin-bottom: 20px;
}
.tools-hero__badge {
    display: inline-block;
    background: rgba(99, 102, 241, 0.10);
    color: #4f46e5;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 12px;
    text-transform: uppercase;
}
.tools-hero__title {
    color: #1a1a2e;
    font-size: 32px;
    font-weight: 800;
    margin: 0 0 8px;
    letter-spacing: -0.4px;
}
.tools-hero__subtitle {
    color: #555;
    font-size: 15px;
    line-height: 1.55;
    max-width: 640px;
    margin: 0 auto 16px;
}
.tools-hero__cta-row { margin-top: 4px; }
.tools-hero__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.30);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
}
.tools-hero__cta:hover, .tools-hero__cta:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.40);
    color: #fff;
    text-decoration: none;
}

/* ===== FILTERS ===== */
.tools-filters {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 18px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.06);
}
.tools-filters__search {
    position: relative;
    margin-bottom: 12px;
}
.tools-filters__search i {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: #888; font-size: 18px;
}
.tools-filters__search input {
    width: 100%;
    padding: 11px 14px 11px 40px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #1a1a2e;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.tools-filters__search input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}
.tools-filters__pills {
    display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px;
}
.tools-pill {
    display: inline-flex; align-items: center; gap: 6px;
    background: #f8f9fa; color: #1a1a2e; border: 1px solid #e5e7eb;
    padding: 7px 14px; border-radius: 999px;
    font-size: 13px; font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}
.tools-pill:hover, .tools-pill:focus-visible {
    background: #eef0ff; border-color: #c7cae0; color: #4f46e5; text-decoration: none;
}
.tools-pill--active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; border-color: transparent;
}
.tools-pill--active:hover, .tools-pill--active:focus-visible { color: #fff; background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.tools-pill__count {
    background: rgba(0, 0, 0, 0.08);
    padding: 1px 7px; border-radius: 999px;
    font-size: 11px; font-weight: 700;
}
.tools-pill--active .tools-pill__count { background: rgba(255, 255, 255, 0.22); color: #fff; }
.tools-filters__sort-row {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    padding-top: 10px; border-top: 1px solid #f1f3f5;
}
.tools-filters__sort-label { color: #666; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-right: 6px; }
.tools-sort-pill {
    background: transparent; color: #555; border: 1px solid #e5e7eb;
    padding: 5px 12px; border-radius: 999px;
    font-size: 12px; font-weight: 600;
    text-decoration: none; transition: all 0.2s;
}
.tools-sort-pill:hover, .tools-sort-pill:focus-visible { color: #4f46e5; border-color: #c7cae0; text-decoration: none; }
.tools-sort-pill--active { background: #4f46e5; color: #fff; border-color: #4f46e5; }
.tools-sort-pill--active:hover, .tools-sort-pill--active:focus-visible { color: #fff; background: #4338ca; border-color: #4338ca; }
.tools-filters__reset { padding-top: 10px; }
.tools-filters__reset-link { color: #888; font-size: 12px; text-decoration: none; }
.tools-filters__reset-link:hover { color: #ef4444; text-decoration: none; }

/* ===== GRID + CARD ===== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.tool-card {
    display: flex; flex-direction: column; gap: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 18px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.06);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s, border-color 0.2s;
}
.tool-card:hover, .tool-card:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(99, 102, 241, 0.16);
    border-color: #c7cae0;
    text-decoration: none;
    color: inherit;
}
.tool-card__top { display: flex; gap: 12px; align-items: center; }
.tool-card__logo {
    width: 56px; height: 56px;
    object-fit: contain;
    border-radius: 10px;
    background: #f8f9fa;
    padding: 4px;
    flex-shrink: 0;
    border: 1px solid #f1f3f5;
}
.tool-card__logo--placeholder {
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-weight: 800; font-size: 22px;
    border: none;
}
.tool-card__head { flex: 1; min-width: 0; }
.tool-card__name {
    color: #1a1a2e;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 3px;
    line-height: 1.2;
    overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
}
.tool-card__category {
    color: #6366f1;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.4px;
}
.tool-card__desc {
    color: #555;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
    overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.tool-card__chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ===== CHIPS ===== */
.tool-chip {
    display: inline-flex; align-items: center; gap: 4px;
    background: #f8f9fa; color: #555;
    padding: 4px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 600;
    border: 1px solid #f1f3f5;
}
.tool-chip i { font-size: 13px; }
.tool-chip--green { background: rgba(16, 185, 129, 0.10); color: #047857; border-color: rgba(16, 185, 129, 0.18); }
.tool-chip--amber { background: rgba(245, 158, 11, 0.10); color: #92400e; border-color: rgba(245, 158, 11, 0.20); }
.tool-chip--tp { background: rgba(0, 182, 122, 0.10); color: #00724d; border-color: rgba(0, 182, 122, 0.18); }
.tool-chip--partner { background: rgba(99, 102, 241, 0.10); color: #4f46e5; border-color: rgba(99, 102, 241, 0.20); }

/* ===== EMPTY STATE ===== */
.tools-empty {
    background: #fff;
    border: 1px dashed #e5e7eb;
    border-radius: 14px;
    text-align: center;
    padding: 40px 24px;
    color: #555;
}
.tools-empty i { font-size: 40px; color: #c7cae0; margin-bottom: 8px; }
.tools-empty h3 { color: #1a1a2e; margin: 0 0 6px; font-size: 18px; }
.tools-empty p { margin: 0 0 12px; color: #777; font-size: 13px; }
.tools-empty__cta {
    display: inline-block;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff; padding: 9px 18px; border-radius: 8px;
    text-decoration: none; font-weight: 600; font-size: 13px;
}
.tools-empty__cta:hover { color: #fff; text-decoration: none; }

/* ===== PAGINATION ===== */
.tools-pagination {
    display: flex; justify-content: center; margin-top: 24px;
}
.tools-pagination .pagination {
    background: #fff; border-radius: 10px; padding: 4px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.08);
    display: flex; gap: 4px; list-style: none; margin: 0;
}
.tools-pagination .page-link,
.tools-pagination a.page-link {
    background: #fff;
    color: #4f46e5;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.tools-pagination a.page-link:hover {
    background: #eef0ff;
    color: #4338ca;
    border-color: #c7d2fe;
    text-decoration: none;
}
.tools-pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border-color: transparent;
}
.tools-pagination .page-item.disabled .page-link {
    color: #9ca3af;
    background: #f9fafb;
    border-color: #e5e7eb;
    pointer-events: none;
}

/* ===== SHOW PAGE ===== */
.tool-show-hero {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.08);
    margin-bottom: 18px;
}
.tool-show-hero__top { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.tool-show-hero__logo {
    width: 80px; height: 80px;
    object-fit: contain;
    background: #f8f9fa;
    border-radius: 14px;
    padding: 6px;
    border: 1px solid #f1f3f5;
}
.tool-show-hero__logo--placeholder {
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff; font-weight: 800; font-size: 32px;
    border: none;
}
.tool-show-hero__name { color: #1a1a2e; font-size: 28px; font-weight: 800; margin: 0 0 4px; letter-spacing: -0.3px; }
.tool-show-hero__cat {
    display: inline-flex; align-items: center; gap: 5px;
    color: #6366f1; font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    text-decoration: none;
}
.tool-show-hero__cat:hover { text-decoration: underline; color: #4338ca; }
.tool-show-hero__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tool-show-hero__chips .tool-chip { font-size: 12px; padding: 5px 12px; }
.tool-show-hero__desc { color: #555; font-size: 14px; line-height: 1.6; margin: 0 0 16px; }
.tool-show-hero__cta-row { display: flex; gap: 10px; flex-wrap: wrap; }
.tool-show-hero__cta {
    display: inline-flex; align-items: center; gap: 8px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 14px; font-weight: 700;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.30);
    transition: transform 0.2s, box-shadow 0.2s;
}
.tool-show-hero__cta:hover, .tool-show-hero__cta:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.40);
    color: #fff; text-decoration: none;
}

.tool-show-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.06);
    margin-bottom: 16px;
}
.tool-show-card__title {
    color: #1a1a2e; font-size: 18px; font-weight: 700; margin: 0 0 14px;
    padding-bottom: 10px; border-bottom: 1px solid #f1f3f5;
}
.tool-show-card__body { color: #333; font-size: 14px; line-height: 1.65; }
.tool-show-table { width: 100%; border-collapse: collapse; }
.tool-show-table th, .tool-show-table td {
    text-align: left; padding: 10px 0; border-bottom: 1px solid #f1f3f5;
    font-size: 14px;
}
.tool-show-table th { color: #666; font-weight: 600; width: 35%; }
.tool-show-table td { color: #1a1a2e; }
.tool-show-table tr:last-child th, .tool-show-table tr:last-child td { border-bottom: none; }
.tool-show-table a { color: #6366f1; text-decoration: none; }
.tool-show-table a:hover { text-decoration: underline; color: #4338ca; }
.tool-show-verified {
    display: inline-flex; align-items: center; gap: 4px;
    color: #047857; font-weight: 700;
}
.tool-show-features { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.tool-show-features li { display: flex; align-items: flex-start; gap: 6px; color: #333; font-size: 14px; line-height: 1.45; }
.tool-show-features li i { color: #10b981; font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.tool-show-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-show-tag {
    background: #f8f9fa; color: #1a1a2e; border: 1px solid #e5e7eb;
    padding: 5px 12px; border-radius: 999px;
    font-size: 12px; font-weight: 600;
}
.tool-show-tag--integration { background: rgba(99, 102, 241, 0.06); color: #4f46e5; border-color: rgba(99, 102, 241, 0.18); }

.tool-show-bottom-cta {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 14px;
    text-align: center;
    padding: 28px 22px;
    color: #fff;
    margin: 22px 0;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.25);
}
.tool-show-bottom-cta h3 { color: #fff; font-size: 20px; font-weight: 700; margin: 0 0 14px; }
.tool-show-bottom-cta__btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: #fff; color: #4f46e5;
    padding: 12px 26px; border-radius: 10px;
    font-size: 15px; font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}
.tool-show-bottom-cta__btn:hover, .tool-show-bottom-cta__btn:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    color: #4338ca; text-decoration: none;
}

.tool-show-related { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.tool-show-related__card {
    display: flex; align-items: center; gap: 10px;
    background: #fafbff; border: 1px solid #eef0f7; border-radius: 10px;
    padding: 10px 12px;
    color: #1a1a2e; text-decoration: none;
    transition: transform 0.2s, border-color 0.2s;
}
.tool-show-related__card:hover, .tool-show-related__card:focus-visible {
    transform: translateY(-2px); border-color: #c7cae0;
    color: #1a1a2e; text-decoration: none;
}
.tool-show-related__card img { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; background: #fff; padding: 3px; border: 1px solid #f1f3f5; }
.tool-show-related__card strong { display: block; font-size: 13px; }
.tool-show-related__price { display: block; color: #777; font-size: 11px; }

/* ===== COMPARE PAGE ===== */
.tools-compare-picker {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
    padding: 18px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.06);
    margin-bottom: 18px;
}
.tools-compare-picker__row {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.tools-compare-slot { display: flex; flex-direction: column; gap: 6px; }
.tools-compare-slot__label { color: #666; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.tools-compare-search { position: relative; }
.tools-compare-search__input {
    width: 100%; padding: 9px 12px;
    border: 1px solid #e5e7eb; border-radius: 8px;
    font-size: 13px; color: #1a1a2e; background: #fff;
}
.tools-compare-search__input:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18); }
.tools-compare-dropdown {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 8px;
    max-height: 240px; overflow-y: auto;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.10); z-index: 50;
}
.tools-compare-dropdown__row {
    width: 100%; display: flex; align-items: center; gap: 8px;
    padding: 7px 11px; border: none; background: transparent;
    font-size: 13px; color: #1a1a2e; cursor: pointer; text-align: left;
}
.tools-compare-dropdown__row:hover, .tools-compare-dropdown__row:focus { background: #f8f9fa; }
.tools-compare-dropdown__row img { width: 22px; height: 22px; object-fit: contain; border-radius: 4px; background: #f8f9fa; padding: 1px; }
.tools-compare-dropdown__placeholder {
    width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; font-weight: 700; font-size: 11px; border-radius: 4px;
}
.tools-compare-dropdown__empty { padding: 10px; color: #888; font-size: 12px; text-align: center; }
.tools-compare-selected {
    display: flex; align-items: center; gap: 6px;
    background: #eef0ff; color: #1a1a2e; border: 1px solid #c7cae0;
    padding: 5px 10px; border-radius: 8px; font-size: 12px; font-weight: 600;
    margin-top: 4px;
}
.tools-compare-selected img { border-radius: 4px; background: #fff; padding: 1px; }
.tools-compare-remove {
    background: transparent; border: none; color: #888; font-size: 18px; cursor: pointer;
    padding: 0; line-height: 1; margin-left: auto;
}
.tools-compare-remove:hover { color: #ef4444; }
.tools-compare-picker__cta-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.tools-compare-go {
    background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
    border: none; padding: 11px 22px; border-radius: 10px;
    font-size: 14px; font-weight: 700; cursor: pointer;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.30);
    transition: transform 0.2s, box-shadow 0.2s;
}
.tools-compare-go:hover, .tools-compare-go:focus-visible {
    transform: translateY(-2px); box-shadow: 0 10px 24px rgba(99, 102, 241, 0.40);
}
.tools-compare-go i { margin-right: 6px; }
.tools-compare-browse { color: #fff; text-decoration: underline; font-size: 13px; }
.tools-compare-browse:hover { color: #fff; text-decoration: none; }

.tools-compare-empty {
    background: #fff; border: 1px dashed #e5e7eb; border-radius: 14px;
    padding: 36px 22px; text-align: center; color: #555;
}
.tools-compare-empty i { font-size: 40px; color: #c7cae0; margin-bottom: 6px; }
.tools-compare-empty h3 { color: #1a1a2e; margin: 0 0 6px; font-size: 18px; }
.tools-compare-empty p { margin: 0; color: #777; font-size: 13px; }

.tools-compare-results { padding-top: 12px; padding-bottom: 24px; }
.tools-compare-table-wrap {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
    padding: 4px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.06);
    overflow-x: auto;
}
.tools-compare-table {
    width: 100%; border-collapse: collapse;
    background: #fff;
    color: #1a1a2e;
}
.tools-compare-table th, .tools-compare-table td {
    padding: 12px 14px; border-bottom: 1px solid #f1f3f5;
    font-size: 13.5px; vertical-align: top;
}
.tools-compare-table thead th {
    background: #f8f9fa;
    color: #1a1a2e; font-weight: 700;
    border-bottom: 2px solid #e5e7eb;
}
.tools-compare-table tbody th { color: #666; font-weight: 600; width: 180px; }
.tools-compare-table__rowhead { width: 180px; }
.tools-compare-table__th {
    display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 140px;
    text-align: center;
}
.tools-compare-table__th img { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 8px; padding: 3px; border: 1px solid #f1f3f5; }
.tools-compare-table__th a { color: #1a1a2e; text-decoration: none; font-weight: 700; }
.tools-compare-table__th a:hover { color: #4f46e5; text-decoration: underline; }
.tools-compare-feature-list { margin: 0; padding-left: 18px; color: #333; font-size: 13px; line-height: 1.5; }
.tools-compare-feature-list li { margin-bottom: 3px; }
.tools-compare-visit {
    display: inline-flex; align-items: center; gap: 5px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
    padding: 7px 14px; border-radius: 8px;
    font-size: 12px; font-weight: 700; text-decoration: none;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.30);
}
.tools-compare-visit:hover, .tools-compare-visit:focus-visible {
    color: #fff; text-decoration: none; transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(99, 102, 241, 0.40);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
    .tools-compare-picker__row { grid-template-columns: repeat(2, 1fr); }
    .tools-hero__title { font-size: 26px; }
    .tool-show-hero__name { font-size: 22px; }
}
@media (max-width: 575px) {
    .tools-grid { grid-template-columns: 1fr; }
    .tools-compare-picker__row { grid-template-columns: 1fr; }
    .tool-show-hero__top { flex-direction: column; align-items: flex-start; }
    .tool-show-features { grid-template-columns: 1fr; }
    .tools-hero { padding: 20px 16px; }
    .tools-hero__title { font-size: 22px; }
    .tools-compare-table tbody th { width: auto; }
    .tools-compare-table__rowhead { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .tools-hero__cta, .tool-show-hero__cta, .tool-show-bottom-cta__btn,
    .tools-compare-go, .tools-compare-visit, .tool-card, .tool-show-related__card {
        transition: none;
    }
}
