/* Shared browse/search tool cards — homepage + hub grids */

.tools-grid,
.category-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    align-items: stretch;
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    align-items: stretch;
}

.tools-grid .tool-card,
.search-results-grid .tool-card,
.category-tools-grid .tool-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 18px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    text-align: left;
    align-items: stretch;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.tools-grid .tool-card::before,
.search-results-grid .tool-card::before,
.category-tools-grid .tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #e9ecef;
}

.tools-grid .tool-card:hover,
.search-results-grid .tool-card:hover,
.category-tools-grid .tool-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.14);
}

.tools-grid .tool-card.comparison-selected,
.search-results-grid .tool-card.comparison-selected,
.category-tools-grid .tool-card.comparison-selected {
    border: 2px solid #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.tools-grid .comparison-add-button,
.search-results-grid .comparison-add-button,
.category-tools-grid .comparison-add-button {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.tools-grid .comparison-add-button:hover,
.search-results-grid .comparison-add-button:hover,
.category-tools-grid .comparison-add-button:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: scale(1.1);
}

.tools-grid .tool-card-body,
.search-results-grid .tool-card-body,
.category-tools-grid .tool-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tools-grid .tool-name,
.search-results-grid .tool-name,
.category-tools-grid .tool-name {
    min-height: 2.6em;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.3;
}

.tools-grid .tool-tags,
.search-results-grid .tool-tags,
.category-tools-grid .tool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    align-content: flex-start;
    min-height: 60px;
    margin-bottom: 12px;
}

.tools-grid .tool-tag,
.search-results-grid .tool-tag,
.category-tools-grid .tool-tag {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    line-height: 1.25;
    box-sizing: border-box;
}

.tools-grid .tool-tag-more,
.search-results-grid .tool-tag-more,
.category-tools-grid .tool-tag-more {
    background: #f1f3f5;
    color: #6c757d;
}

.search-results-grid .tool-tag.tool-tag-download-available {
    background: #eef1f6;
    color: #5c6578;
    border: 1px solid #dde3ec;
}

.tools-grid .scores-compact,
.search-results-grid .scores-compact,
.category-tools-grid .scores-compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
}

.tools-grid .scores-compact .score-overall,
.search-results-grid .scores-compact .score-overall,
.category-tools-grid .scores-compact .score-overall {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    padding: 12px 10px;
    text-align: center;
}

.tools-grid .scores-compact .score-overall .score-label,
.search-results-grid .scores-compact .score-overall .score-label,
.category-tools-grid .scores-compact .score-overall .score-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.75rem;
    margin-bottom: 4px;
}

.tools-grid .scores-compact .score-overall .score-value,
.search-results-grid .scores-compact .score-overall .score-value,
.category-tools-grid .scores-compact .score-overall .score-value {
    color: white;
    font-size: 1.35rem;
    font-weight: 700;
}

.tools-grid .scores-compact .score-overall .score-stars,
.search-results-grid .scores-compact .score-overall .score-stars,
.category-tools-grid .scores-compact .score-overall .score-stars {
    color: #ffc107;
    margin-top: 4px;
}

.tools-grid .score-trio,
.search-results-grid .score-trio,
.category-tools-grid .score-trio {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.tools-grid .score-mini,
.search-results-grid .score-mini,
.category-tools-grid .score-mini {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px 4px;
    text-align: center;
}

.tools-grid .score-mini .score-label,
.search-results-grid .score-mini .score-label,
.category-tools-grid .score-mini .score-label {
    font-size: 0.65rem;
    color: #6c757d;
    line-height: 1.2;
    margin-bottom: 4px;
}

.tools-grid .score-mini .score-value,
.search-results-grid .score-mini .score-value,
.category-tools-grid .score-mini .score-value {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
}

.tools-grid .tool-card-actions,
.search-results-grid .tool-card-actions,
.category-tools-grid .tool-card-actions {
    margin-top: 10px;
    text-align: center;
}

.tools-grid .tool-card .find-button,
.search-results-grid .tool-card .find-button,
.category-tools-grid .tool-card .find-button {
    display: inline-block;
    text-decoration: none;
    margin-top: 0;
    padding: 10px 20px;
    font-size: 0.9rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tools-grid .tool-card .find-button:hover,
.search-results-grid .tool-card .find-button:hover,
.category-tools-grid .tool-card .find-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(102, 126, 234, 0.3);
}
