/**
 * Trade Filter Button Styles
 * Pre-filter categories before loading instances
 */

.trade-filter-container {
    padding: 20px;
    background: var(--card-bg, #ffffff);
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.trade-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color, #e0e0e0);
}

.trade-filter-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #333);
    display: flex;
    align-items: center;
    gap: 10px;
}

.trade-filter-count {
    font-size: 14px;
    color: var(--text-secondary, #666);
    background: var(--bg-secondary, #f5f5f5);
    padding: 4px 12px;
    border-radius: 20px;
}

.trade-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.trade-btn {
    position: relative;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #333);
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.trade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color, #667eea);
}

.trade-btn.active {
    background: linear-gradient(135deg, var(--primary-color, #667eea) 0%, var(--secondary-color, #764ba2) 100%);
    color: white;
    border-color: var(--primary-color, #667eea);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.trade-btn.all-instances {
    grid-column: span 2;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    font-size: 16px;
    padding: 16px;
    text-align: center;
    justify-content: center;
    align-items: center;
}

.trade-btn.all-instances:hover {
    background: linear-gradient(135deg, #45a049 0%, #4CAF50 100%);
}

.trade-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.trade-name {
    font-weight: 600;
    line-height: 1.3;
}

.trade-description {
    font-size: 12px;
    opacity: 0.8;
    line-height: 1.2;
}

.trade-count-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.2);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* Loading state */
.trade-btn.loading {
    pointer-events: none;
    opacity: 0.6;
}

.trade-btn.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: loading-sweep 1.5s infinite;
}

@keyframes loading-sweep {
    to {
        left: 100%;
    }
}

/* Category-specific colors */
.trade-btn[data-category="horizontal"] {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
}

.trade-btn[data-category="vertical"] {
    background: linear-gradient(135deg, #696969 0%, #808080 100%);
    color: white;
}

.trade-btn[data-category="hvac"] {
    background: linear-gradient(135deg, #1E90FF 0%, #4169E1 100%);
    color: white;
}

.trade-btn[data-category="electrical"] {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #333;
}

.trade-btn[data-category="plumbing"] {
    background: linear-gradient(135deg, #008080 0%, #20B2AA 100%);
    color: white;
}

.trade-btn[data-category="exterior"] {
    background: linear-gradient(135deg, #CD853F 0%, #DEB887 100%);
    color: white;
}

.trade-btn[data-category="doors-windows"] {
    background: linear-gradient(135deg, #4682B4 0%, #5F9EA0 100%);
    color: white;
}

.trade-btn[data-category="interiors"] {
    background: linear-gradient(135deg, #9370DB 0%, #BA55D3 100%);
    color: white;
}

.trade-btn[data-category="landscape"] {
    background: linear-gradient(135deg, #228B22 0%, #32CD32 100%);
    color: white;
}

.trade-btn[data-category="hardscape"] {
    background: linear-gradient(135deg, #778899 0%, #708090 100%);
    color: white;
}

/* Action buttons */
.filter-actions {
    display: flex;
    gap: 12px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color, #e0e0e0);
}

.action-btn {
    padding: 10px 20px;
    background: var(--bg-secondary, #f5f5f5);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn:hover {
    background: var(--primary-color, #667eea);
    color: white;
    transform: translateY(-1px);
}

.load-btn {
    flex: 1;
    background: var(--primary-color, #667eea);
    color: white;
    border: none;
    font-size: 16px;
    padding: 12px;
}

.load-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .trade-categories {
        grid-template-columns: 1fr;
    }
    
    .trade-btn.all-instances {
        grid-column: span 1;
    }
    
    .trade-btn {
        padding: 10px 14px;
    }
}